[help wanted] How to keep extmark from removed after commenting code #959
-
hello, very thanks for your nice work! I found that I originally wanted to post on Reddit, but it seems that my account and IP have been banned. I'm sorry if this has caused any inconvenience. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi, @shellRaining! I remember seeing screenshots of that chunk highlighting and thinking that it was beautiful. Nice work! Applying Extmarks from 'mini.indentscope' are not exceptions. The way 'mini.indentscope' makes it look like extmarks don't move is by redrawing on every 'TextChanged' event immediately before Neovim redraws the screen. In turn, 'mini.indentscope' decides whether it should redraw scope immediately or not is by comparing currently drawn scope with target. If those scopes intersect, then it draws with delay 0 the whole scope right away. So in short: it re-adds extmarks very quickly after every text change. For the future, this type of question is better be posted in Discussions directly. I've transferred this one myself. |
Beta Was this translation helpful? Give feedback.
Hi, @shellRaining! I remember seeing screenshots of that chunk highlighting and thinking that it was beautiful. Nice work!
Applying
nvim_buf_set_lines()
indeed "squashes" all extmarks to be on either side of set lines. This is essentially close to manually deleting those lines (which moves extmarks) and pasting text (which also might move extmarks).Extmarks from 'mini.indentscope' are not exceptions. The way 'mini.indentscope' makes it look like extmarks don't move is by redrawing on every 'TextChanged' event immediately before Neovim redraws the screen.
In turn, 'mini.indentscope' decides whether it should redraw scope immediately or not is by comparing currently drawn scope with target…