Skip to content

Commit

Permalink
clear_all_highlights: check if buffer is loaded (#709)
Browse files Browse the repository at this point in the history
when buffer is not loaded, len(getbufline(...)) returns 0, calling
prop_remove(..., lnum=1, lnum-end=0) which fails with invalid range
error
  • Loading branch information
taiyu-len authored Feb 8, 2020
1 parent d35d297 commit f33d624
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/lsp/ui/vim/diagnostics/textprop.vim
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function! s:clear_all_highlights() abort
endif

for l:bufnr in range(1, bufnr('$'))
if bufexists(l:bufnr)
if bufexists(l:bufnr) && bufloaded(l:bufnr)
call prop_remove({
\ 'type': l:prop_type,
\ 'bufnr': l:bufnr,
Expand Down

0 comments on commit f33d624

Please sign in to comment.