mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
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.
This commit is contained in:
@@ -190,9 +190,10 @@ function! s:init_reference_highlight(buf) abort
|
||||
\ 'combine': v:true,
|
||||
\ 'priority': lsp#internal#textprop#priority('document_highlight')
|
||||
\ }
|
||||
call prop_type_delete('vim-lsp-reference-highlight', l:props)
|
||||
if prop_type_get('vim-lsp-reference-highlight', { 'bufnr': a:buf }) == {}
|
||||
call prop_type_add('vim-lsp-reference-highlight', l:props)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Cyclically move between references by `offset` occurrences.
|
||||
|
||||
Reference in New Issue
Block a user