RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.16k stars 47 forks source link

Bad highlighting in folded lines #52

Closed lervag closed 3 years ago

lervag commented 3 years ago

In neovim v0.5 (nightly), I experience a strange bug where vim-illuminate highlighting for some reason breaks the highlighting of folded lines.

I made a minimal example:

syntax enable

set termguicolors
highlight Folded gui=bold guibg=white guifg=red
highlight MyWord gui=bold guibg=red   guifg=white

nnoremap q :qall!<cr>

silent edit test.txt
normal! zM
redraw!
sleep 1

normal! zR
redraw!
sleep 1

call matchadd('MyWord', '\V' . 'test', -1)
redraw!
sleep 1

normal! zM

where text.txt contains e.g. this:

{{{ test 1

}}}
{{{ test 2

}}}
{{{ test 3

}}}
{{{ test 2

}}}
{{{ test 3

}}}
{{{ test 2

}}}
{{{ test 3

}}}

# vim: fdm=marker

I believe this is really a bug with neovim which is already discussed here: https://github.com/neovim/neovim/issues/12982. However, vim-illuminate relies on this specific feature and so becomes partly broken because of this bug. Thus, I thought it was polite to mention it here. It might be OK to simply close the issue again immediately.

RRethy commented 3 years ago

I'll take a look, thanks for letting me know. I've been using an older version of Neovim so didn't notice.

lervag commented 3 years ago

No problem. :)

RRethy commented 3 years ago

I can' seem to reproduce with your example.

Screen Shot 2020-11-18 at 9 37 16 PM Screen Shot 2020-11-18 at 9 37 20 PM Screen Shot 2020-11-18 at 9 37 25 PM Screen Shot 2020-11-18 at 9 37 33 PM

Will leave open though and watch the issue on neovim.

lervag commented 3 years ago

Which version of neovim? I'm on 0.5.0-839 (compiled from nightly a few days ago).

RRethy commented 3 years ago

Nvm I was using and older version of Neovim (0.5.0-541). I see the behaviour you mentioned, I'll keep an eye on the linked issue.

RRethy commented 3 years ago

https://github.com/neovim/neovim/pull/13393