-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(screen): virtual lines #15351
feat(screen): virtual lines #15351
Conversation
The title of this PR means something awesome! |
TODO item: |
added options: TODO: cannot display virt_lines below last line. (above first line works, need to scroll up tho after adding) |
9301b11
to
56abba0
Compare
cce47e6
to
51512c0
Compare
Please correct me if I'm wrong, but I think this could be used for the use-case mentioned in #9496 (comment) (linked Reddit post: https://www.reddit.com/r/neovim/comments/ieh7l4/im_building_an_image_plugin_and_need_some_help/). I imagine it would enable plugins such as https://github.com/heapslip/vimage.nvim and https://github.com/edluffy/hologram.nvim to make virtual space for displaying images without tampering with the buffer. Is this assumption correct? |
As I understand it, yes. On the same line, it would also be quite helful in https://github.com/dccsillag/magma-nvim in order to have output windows which do not cover any of the buffer text. |
b65f333
to
4cf1133
Compare
918e46f
to
4c87abe
Compare
@dccsillag Would be amazing! Also can be useful for VCS tools. |
5825838
to
f343f5d
Compare
This comment has been minimized.
This comment has been minimized.
@max397574 make sure that |
Note the double braces on the |
Cursor movement seems to remove the virtual lines for me. Does anyone else also experience this? Update: doesn't happen with |
Weird, I can't reproduce it anymore. |
@Shougo is there a branch somewhere with the actual code? otherwise I cannot reproduce. |
I have pushed code. I have tested echodoc master branch with the config. let g:echodoc#type = has('nvim') ? 'virtual_lines' : 'popup'
call echodoc#enable() |
I have tested it with ddc.vim neco-vim echodoc with Vim script editing. |
that... sounds like a lot of stuff to setup and many layers to debug. maybe I will check it later. |
I am also encountering this issue. This happens very frequently with vim-matchup's matchparen feature. If I run |
I'm not sure about a better place to ask this, so I'll just do that here: do you plan on supporting some sort of cursor navigation into virtual lines? |
the whole point of virtual lines is that they don't rly are there so you can't move the cursor on them I think? |
But it would be really nice. Because it would be an easy way to have temporary text. |
Pretty sure the whole point of virtual lines is to have lines that aren't in the buffer. That means that things such as LSP won't pick up on them, and they can't be accidentaly saved. This is mostly orthogonal to allowing the cursor to be on them. |
I absolutely get that! But having some way of moving onto them would be nice. Kinda like |
That sounds more like embedding a sub-buffer into a window (so that the cursor can take positions within the embedded buffer). which might be something we can do, but separate from virtual text/lines as such (which are rather UI elements like statusline/whatevercolumn) |
Hm interesting 🤔 So do you think like a borderless floating window which gets inserted between lines? That would probably also deal with buffer changes better than the current virtual lines because they get removed after a buffer change. However, if (for example) the ToC were in a yet entirely different buffer that could arguably be handled a bit better.. |
These sorts of attached floating windows sound really cool! They could help out in a lot of scenarios. If the item is treated as an isolated buffer then it gives a lot of freedom to the programmer without having to be worried about messing up the buffer it's contained in :) |
Note: probably not the final api. But for now
Limitation: only one (1) block of virtual lines per buffer! To enable quick prototyping. we can lift this limitation later.