Skip to content

Commit 23728ad

Browse files
Fix loss of reference highlights on buffer change (#1355)
Co-authored-by: Prabir Shrestha <[email protected]>
1 parent d45273a commit 23728ad

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

autoload/lsp/internal/document_highlight.vim

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,16 @@ function! s:in_reference(reference_list) abort
183183
endfunction
184184

185185
function! s:init_reference_highlight(buf) abort
186-
if !empty(getbufvar(a:buf, 'lsp_did_reference_setup'))
187-
return
188-
endif
189-
190186
if s:use_vim_textprops
191-
call prop_type_add('vim-lsp-reference-highlight', {
187+
let l:props = {
192188
\ 'bufnr': a:buf,
193189
\ 'highlight': 'lspReference',
194190
\ 'combine': v:true,
195191
\ 'priority': lsp#internal#textprop#priority('document_highlight')
196-
\ })
192+
\ }
193+
call prop_type_delete('vim-lsp-reference-highlight', l:props)
194+
call prop_type_add('vim-lsp-reference-highlight', l:props)
197195
endif
198-
199-
call setbufvar(a:buf, 'lsp_did_reference_setup', 1)
200196
endfunction
201197

202198
" Cyclically move between references by `offset` occurrences.

0 commit comments

Comments
 (0)