vim-lsp
vim-lsp copied to clipboard
Fix loss of reference highlights on buffer change
This PR fixes an issue where document highlighting of references will stop working on buffers that have switched to a different buffer within the same window.
Instead of returning after checking if a buffer already has a text property type added, this commit will remove the existing property type and add it back each time a buffer changes.
To reproduce the issue:
- enable
g:lsp_document_highlight_enabled
- open a file supported by a language server
- highlight a reference
- switch to another buffer (e.g.,
:bn
,:e new
,:LspDefinition
) - switch back to previous buffer (e.g.,
:bp
, CTRL+6, CTRL+O) - try to highlight a reference
Before fix:
After fix: