-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
anticonceal (virtual text occupying horizontal space) #9496
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
base: master
Are you sure you want to change the base?
Conversation
👍
Would "grow vertically" be a similar effect as diff "filler lines"? |
Ah that's true. So there already is logic for managing vertical space from changes outside the buffer itself, we should follow that then. |
Would it be feasible to generalize conceal to full strings rather than single characters from these changes? |
Yes. It would be feasible to replace any character range with any string (within a line). The question is what we do with cursor positions within. |
Bump and usecase report: rust-analyzer provides a compelling use case for this, see fannheyward/coc-rust-analyzer#177 (comment). Currently only chainingHints are provided due to this limitation. |
Bump, usecase is adding empty virtual lines to draw images. https://www.reddit.com/r/neovim/comments/ieh7l4/im_building_an_image_plugin_and_need_some_help/ |
Bumping this again with another usecase: displaying titles of linked notes inline. This would be really useful! |
Willing to put $200 bounty on this. I know that’s likely not enough, but I want to provide the most incentive I can currently afford and see if others feel alike. |
This comment has been minimized.
This comment has been minimized.
One more usecase - pull request comments/in-nvim review: #15331 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@Ciel-MC we accept contributions. Please send a pull request if you'd like to implement this. |
See vim/vim#260. Might be fixed by NeoVIM soonish with their "anticonceal" project. Also: nvim-neorg/neorg#292 Also: neovim/neovim#14409 Also: neovim/neovim#9496 Including `gettysburg.md` to check when conceal is working property, if ever. Note that everyone claims that concel works better in Emacs.
This comment was marked as spam.
This comment was marked as spam.
After #20130 is merged, NeoVim has got Vim's solution for inlay hints. Right after first usages I'm spotting usability issues that relate to the quote above. Movement over a buffer with intermixed virtual text is affected by it, using Ideally, while editing code, virtual text would be passed-through, popping in and out of existence meanwhile real content changes. If that's not attained, then we have what we have now, virtual text confusingly positing as real text. |
I don't see this happening at all. Is there a screenshot or perhaps a small video? |
@bfredl (click to expand resolution): clangd is in use, by means of coc-clangd. |
Hmm this is not the behavior I get. But perhaps it is affected by options, like cpoptions which are not the default here. |
This comment was marked as duplicate.
This comment was marked as duplicate.
A couple questions on the above discussion:
where
where the lines with |
More of TODO than WIP to be honest, but at least "conceptual" preview of something that can become a generalization of virttext, where virtual text also can be placed in the middle of a line an not only at the end. When working on #9492 I finally understood the remaining missing pieces how horizontal cursor movement/tracking works with conceal, and general virttext can be understood as the the inverse of conceal: we shift vcols to the right rather than the left on the screen.
This currently hard codes some virtual text at line 3 column 10.
h
l
etc cursor movement and mouse clicks should be handled properly. Proper implementation would really need tracking of horizontal changes to marks, so further work will be scheduled after the initial extmark merge #5031.Also an open question is how to deal with extra needed vertical space. Should virttext be truncated, or should the line be allowed to grow vertically due to virtual text? The later sounds more ideal, though this will differ with conceal behaviour, and might break some invariants.
One could even go so far and allow vcols to change, though that could be a larger and more risky endeavour. But on the other hand flexible vcols might be something we want anyway, so the text rendering of an external UI can affect what
gj
andgk
does, and not only vim's hard coded calculation for how much space text should take on screen.