Skip to content

Commit f33d624

Browse files
authored
clear_all_highlights: check if buffer is loaded (#709)
when buffer is not loaded, len(getbufline(...)) returns 0, calling prop_remove(..., lnum=1, lnum-end=0) which fails with invalid range error
1 parent d35d297 commit f33d624

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function! s:clear_all_highlights() abort
7878
endif
7979

8080
for l:bufnr in range(1, bufnr('$'))
81-
if bufexists(l:bufnr)
81+
if bufexists(l:bufnr) && bufloaded(l:bufnr)
8282
call prop_remove({
8383
\ 'type': l:prop_type,
8484
\ 'bufnr': l:bufnr,

0 commit comments

Comments
 (0)