Skip to content

Commit 5009876

Browse files
authored
Fix flicker on document highlighting with vim 9.0.0993 (#1397)
Since v9.0.0993 vim performs a full redraw when removing text property types, which causes flickering because vim-lsp currently removes and re-adds the property type every time the highlight is updated. To avoid that, we can just check if the property type already exists on the given buffer, and only add it if it doesn't exist yet.
1 parent c4bae1f commit 5009876

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

autoload/lsp/internal/document_highlight.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,9 @@ function! s:init_reference_highlight(buf) abort
190190
\ 'combine': v:true,
191191
\ 'priority': lsp#internal#textprop#priority('document_highlight')
192192
\ }
193-
call prop_type_delete('vim-lsp-reference-highlight', l:props)
194-
call prop_type_add('vim-lsp-reference-highlight', l:props)
193+
if prop_type_get('vim-lsp-reference-highlight', { 'bufnr': a:buf }) == {}
194+
call prop_type_add('vim-lsp-reference-highlight', l:props)
195+
endif
195196
endif
196197
endfunction
197198

0 commit comments

Comments
 (0)