helix icon indicating copy to clipboard operation
helix copied to clipboard

Ctrl-d/Ctrl-u to scroll the option's documentation on auto-complete

Open Manosmer opened this issue 2 years ago • 5 comments

Fixes #3062. The Markdown documentation is now treated as a separate Box<Popup<Markdown>>. So, a Completion object now has 2 Popups; one for the Menu(as before) and a new one for the relevant option's documentation. Currently, the code creates a new Box<Popup<Markdown>> only when the user moves to another option.

Let me know if there is any additional optimisation needed, like:

  • ~~running Popup::required_size() inside Completion::render() only when the option changes (currently, it runs every time scroll happens).~~

Manosmer avatar Oct 19 '22 11:10 Manosmer

I imagine the same scroll keys should be used as for scrolling in https://github.com/helix-editor/helix/pull/4189

David-Else avatar Oct 19 '22 14:10 David-Else

I imagine the same scroll keys should be used as for scrolling in https://github.com/helix-editor/helix/pull/4189

Currently, documentation scrolling in popups that appear by doing <Esc><Space>k is possible via Ctrl-d/Ctrl-u. I chose the same keybindings to comply with the above.

Manosmer avatar Oct 19 '22 14:10 Manosmer

This is probably another PR, but it would be great if markdown previews of documentation could show if there was more to scroll up or down to.

At the moment, when you see the docs in a popup you don't know if you are seeing the whole thing or need to scroll down to read more. If there were a symbol like in the bottom right that showed when there was more it would be very useful. There could be an too that does the same thing in reverse.

David-Else avatar Oct 23 '22 12:10 David-Else

Yeah some sort of hint for how much documentation would be a nice feature (though separate from this PR) https://github.com/helix-editor/helix/issues/1248. Maybe a scrollbar is sufficient

the-mikedavis avatar Oct 23 '22 14:10 the-mikedavis

@David-Else @the-mikedavis I could try to copy the menu scroll bar mechanism into the Popup and see how far I can go.

Manosmer avatar Oct 24 '22 09:10 Manosmer

Is there any chance of getting this fix merged? Scrolling inside the auto-complete popup is still broken I think.

RmStorm avatar Aug 03 '23 10:08 RmStorm

closing this one as stale, #8047 is a newer implementation. Thank you for contributing!

pascalkuthe avatar Apr 13 '24 23:04 pascalkuthe