Skip to content

Commit e748025

Browse files
thomasfaingnaertprabirshrestha
authored andcommitted
Check if buffer exists in folding textprops (#495)
1 parent d7e644c commit e748025

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

autoload/lsp/ui/vim/folding.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ function! s:set_textprops(buf) abort
2323
" sent. We will let Vim handle updating the line numbers when the user
2424
" inserts or deletes text.
2525

26+
" Skip if the buffer doesn't exist. This might happen when a buffer is
27+
" opened and quickly deleted.
28+
if !bufexists(a:buf) | return | endif
29+
2630
" Create text property, if not already defined
2731
silent! call prop_type_add(s:textprop_name, {'bufnr': a:buf})
2832

0 commit comments

Comments
 (0)