Genio icon indicating copy to clipboard operation
Genio copied to clipboard

Outline: Mark current position of editor view

Open humdingerb opened this issue 10 months ago • 8 comments

I was wondering... Would it be useful to mark the symbols in the outline view that currently shown in the editor view? Esp. for long functions, you'd have a reminder in which function you're are right now and what are the functions above/below it.

The outline list could bolden all symbol items that currently visible in the editor view. I suppose the outline list should NOT auto-scroll to have those bolded symbols always visible. This would collide with the user scrolling the outline list 'manually'.

humdingerb avatar Apr 21 '24 06:04 humdingerb

Just to add, maybe using a tinted background for the marked items would look nicer?

humdingerb avatar Apr 21 '24 06:04 humdingerb

Just a few thoughts on it. There is no easy way to determine the symbols currently shown in the editor but we may determine the range and do a search in the outline to pick the symbols that completely fall into it. As usual this should be done when idle only.

nexus6-haiku avatar Apr 21 '24 07:04 nexus6-haiku

I was wondering... Would it be useful to mark the symbols in the outline view that currently shown in the editor view? Esp. for long functions, you'd have a reminder in which function you're are right now and what are the functions above/below it.

Yes, it would be very useful. Eclipse (which I used as a "template" for the Outline) selects the symbol in the outline where the caret is in the editor. We'd just have to find out a way to do that.

jackburton79 avatar Apr 21 '24 08:04 jackburton79

Implemented in #396

Freaxed avatar May 25 '24 10:05 Freaxed

Appears to work nicely! At least wrt the smaller goal to show the symbol of the cursor position. The cherry on top would be to tint the background of the symbol items in the Outline pane that are currently visible in the editor. In case you're just scrolling around without moving the cursor position...

I appreciate that this may be more difficult. :) I suppose you'd have to check the top line and bottom line of the current editor view periodically and determine what symbols they belong to and tint all symbol items in the Outline pane between...

Anyway, nice change!

humdingerb avatar May 25 '24 16:05 humdingerb

I see your idea but I'm afraid it can't be implemented simply because the list of symbols may be not following the code order.. For example clangd orders first the attributes then the methods of a class.

I think the feature you describe is the "MiniMap/code-scroller": a zoomed out view of the code that you can quickly navigate.

Freaxed avatar May 25 '24 19:05 Freaxed

Possibly. Maybe as another tab to add tot he right Outline pane someday. Or some keyboard key that collapses all blocks in the editor view and zoom to 25% while holding. That should compress things nicely and still allows you to orient yourself.

humdingerb avatar May 26 '24 12:05 humdingerb

Implemented in #396

Nice work! Can we close this ? The other request seems interesting, but maybe a bit unrealistic for now.

jackburton79 avatar May 31 '24 06:05 jackburton79