mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.89k stars 711 forks source link

Scrollable info box? #4043

Open VarLad opened 3 years ago

VarLad commented 3 years ago

Feature

Scrollable info box

Usecase

I use julialang with Kak-lsp, which uses kakoune's info box to display docs on lsp-hover The info box fills up the screen and is cut off when I limit the max lines. Any way I can get a scroll bar to scroll along the info box? If not, can I get it implemented as a feature? Thank you

krobelus commented 3 years ago

probably better to display docs in a dedicated buffer, like :doc - this gives more powerful navigation than a scrollbar

VarLad commented 3 years ago

@krobelus It doessn't work.... My issue is that I don't want the docs to fill up the screen... info box are lighter and support markup. Maybe an option like scrollable for info boxes would help!

mawww commented 3 years ago

One issue here is that info-boxes are passed as-is to the UI and Kakoune server has minimal control on how they are rendered: The terminal UI does all the cropping logic to try to make it fit. The reason for that approach is to make it possible for eventual graphical UI to display info boxes as they see fit, but it means that any scrolling support in the info box will need to take place at the client UI level.

This is definitely doable, but it would be a bit weird, as those keys would not go through the regular input stack (no modes, not mappings...).

eko234 commented 3 years ago

I don't know how registers work very well, but maybe adding the content of info boxes to a new register would make it easy to write hooks and bindings to handle large info boxes, Indeed, the writting of a plugin to get the "scrolling feature" would be easier.