Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(toc): add config for enabling synchronized cursorline in toc window #1198

Merged
merged 5 commits into from
Dec 1, 2023

Conversation

champignoom
Copy link
Contributor

@champignoom champignoom commented Nov 27, 2023

New boolean option: sync_cursorline.

When enabled:

  • cursorline is enabled (highlighted) in the ToC window
  • when the cursor of the content window changes, the cursor of the ToC window changes accordingly

So that one can track which section they're reading in the ToC window.

@champignoom champignoom force-pushed the patch-toc-sync-cursorline branch from 8c9ab04 to b9ced90 Compare November 28, 2023 06:26
@champignoom champignoom force-pushed the patch-toc-sync-cursorline branch from 35d2b3d to 71d5380 Compare November 30, 2023 08:15
@champignoom champignoom force-pushed the patch-toc-sync-cursorline branch from 71d5380 to 0f8a6de Compare November 30, 2023 08:25
@vhyrro vhyrro merged commit 15ed981 into nvim-neorg:main Dec 1, 2023
2 checks passed
@vhyrro
Copy link
Member

vhyrro commented Dec 1, 2023

This is great, thank you :)

@rodhash
Copy link

rodhash commented Dec 1, 2023

Wow nice feat! Thank you!

Only one thing I was thinking about

When we open the toc pane the cursor automatically goes all the way to the top.. it goes to the first line "Table of Contents"

Would be nice if the cursor kept synced too .. let's say I'm in the middle of the file under some heading named "foo" .. would be nice if opening the TOC pane the cursor goes to the heading "foo" instead of going to the first line..

this is how Markdown TOC behaves and I find this kind of behavior very useful in large MD files.. after opening the TOC I don't need to scroll down in order to find where I was

Thanks again for this

@pysan3
Copy link
Contributor

pysan3 commented Dec 4, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants