Closed LimbicSys closed 3 years ago
The left cpp file was opened first. Then I opened a plain text file in the right window, the words in cpp file are still highlighted.
If I do not use this plug in lsp mode, it will not highligh the words when I leave the current buffer.
That's intended behaviour. When using LSP, highlighting is done with :h nvim_buf_add_highlight()
while non-lsp highlighting is done with :h matchadd()
, the former adds highlighting to the buffer while the latter adds highlighting to the window. Since the latter adds highlighting to the window, it must be removed when leaving the window or it can become invalid.