helix
helix copied to clipboard
Ctrl-d/Ctrl-u to scroll the option's documentation on auto-complete
Fixes #3062. The Markdown documentation is now treated as a separate Box<Popup<Markdown>>
. So, a Completion
object now has 2 Popup
s; 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()
insideCompletion::render()
only when the option changes (currently, it runs every time scroll happens).~~
I imagine the same scroll keys should be used as for scrolling in https://github.com/helix-editor/helix/pull/4189
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.
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.
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
@David-Else @the-mikedavis I could try to copy the menu scroll bar mechanism into the Popup and see how far I can go.
Is there any chance of getting this fix merged? Scrolling inside the auto-complete popup is still broken I think.
closing this one as stale, #8047 is a newer implementation. Thank you for contributing!