Skip to content

[help wanted] How to keep extmark from removed after commenting code #959

Closed Answered by echasnovski
shellRaining asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@shellRaining
Comment options

@echasnovski
Comment options

@shellRaining
Comment options

@echasnovski
Comment options

Answer selected by echasnovski

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.indentscope
3 participants
Converted from issue

This discussion was converted from issue #958 on June 11, 2024 16:46.