MeanderingProgrammer / markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
503 stars 20 forks source link

Anti-conceal virtual text with cursor #15

Open MeanderingProgrammer opened 3 months ago

MeanderingProgrammer commented 3 months ago

Currently the conceal feature is applied to the buffer as a whole. Meaning anything concealed by Neovim / Tree Sitter is able to be hidden in normal mode but shown when the user's cursor enters that line. For example with links the states are:

Ideally we could do something similar with the virtual text added by this plugin, for example headings would have the following states:

The tricky part here is we essentially want the opposite behavior of a conceal.

As far as I am aware there is not a builtin feature to support this kind of behavior.

Any solution that involves running an auto command on every cursor movement is IMO not viable, turns out it was kind of viable.

If a feature gets released that adds support for this or if I am missing something that already exists please let me know!

Pulled from original issue: https://github.com/MeanderingProgrammer/markdown.nvim/issues/14

MeanderingProgrammer commented 3 months ago

Some discussions that may or may not be relevant: https://github.com/neovim/neovim/pull/9496

MeanderingProgrammer commented 3 days ago

This should hopefully work now after merging: https://github.com/MeanderingProgrammer/markdown.nvim/commit/726c85cb9cc6d7d9c85af6ab093e1ee53b5e3c82.

Will keep this open to track any resulting problems.