Skip to content

Commit 533aef1

Browse files
thomasfaingnaertprabirshrestha
authored andcommitted
Fix clear textprops for unloaded buffers (#430)
1 parent d542bbc commit 533aef1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

autoload/lsp/ui/vim/diagnostics/textprop.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ function! s:clear_highlights(server_name, path) abort
9595
if !s:enabled | return | endif
9696

9797
let l:bufnr = bufnr(a:path)
98+
99+
if l:bufnr == -1
100+
call lsp#log('Skipping clear_highlights for ' . a:path . ': buffer is not loaded')
101+
return
102+
endif
103+
98104
for l:severity in keys(s:severity_sign_names_mapping)
99105
let l:prop_type = s:get_prop_type(a:server_name, l:severity)
100106
call prop_remove({

0 commit comments

Comments
 (0)