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

FR: Auto follow highlight nested items' parent nodes when not expanded #65

Open
lethefrost opened this issue Apr 18, 2024 · 0 comments
Open

Comments

@lethefrost
Copy link

Is your feature request related to a problem? Please describe.
Currently, if you set the outline map to auto follow the viewport, but the auto expand behavior is set to manual or cursor, you will encounter losing the highlight in the outline pane indicating the current viewport position/range from time to time.

There are two types of highlights: the cursor highlight, and the viewport range highlight. The plugin setting only affects the timing of these highlight (and corresponding expanding/collapsing of the tree nodes in the outline pane) get refreshed - whether it refreshes when scrolling (when set to viewport), or when the cursor position changes (cursor), or not refreshing at all if set to manual.

Now the range highlighting in the outline pane only highlights the elements that appear in the current viewport, i.e., those visible on the current screen, and does not simultaneously highlight their parent nodes in the tree along with it. Therefore, when you are reading code that includes a very long function body or class definition, or even just a multi-line variable (such as a dictionary, multiline string, or object literal), and you scroll to the middle part, you will only see the internal elements within your viewport, not the function header or the location where the identifier itself is defined.

Since you have not set these to automatically expand with the viewport, they all appear as collapsed child nodes in the outline window. Consequently, no range highlighting will be shown in the outline window! It can feel like you suddenly lose your bearings, unsure of where you are in the document.

Describe the solution you'd like

Therefore, I believe it is a good idea to also highlight the parent elements in the tree structure when displaying range highlights, to help locate the context of the viewport when all the currently visible elements are collapsed.

Describe alternatives you've considered
For now, in order to always have a clear picture of where you are in the outline, you have to set expand following viewport as well.

Additional context
N.A.

Thank you so much for this plugin! It's really helpful and better than the builtin one in most cases.

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

No branches or pull requests

1 participant