Skip to content

Commit eba0839

Browse files
authored
Check win_findbuf return empty (#922)
Fixes #803
1 parent fdb69ab commit eba0839

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

autoload/lsp/ui/vim/folding.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ function! s:get_line_count_buf(buf) abort
4747
if !has('patch-8.1.1967')
4848
return line('$')
4949
endif
50-
return line('$', win_findbuf(a:buf)[0])
50+
let l:winids = win_findbuf(a:buf)
51+
return empty(l:winids) ? line('$') : line('$', l:winids[0])
5152
endfunction
5253

5354
function! lsp#ui#vim#folding#send_request(server_name, buf, sync) abort

0 commit comments

Comments
 (0)