Skip to content

Commit d45273a

Browse files
authored
Fix Checks for the presence of a dict's key 'linecount' (#1365)
1 parent 8fdaf4f commit d45273a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

autoload/lsp/internal/diagnostics/signs.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,11 @@ function! s:place_signs(server, diagnostics_response, bufnr) abort
131131
let l:line = lsp#utils#position#lsp_line_to_vim(a:bufnr, l:item['range']['start'])
132132

133133
" Some language servers report an unexpected EOF one line past the end
134-
if l:line == getbufinfo(a:bufnr)[0].linecount + 1
135-
let l:line = l:line - 1
134+
" key 'linecount' may be missing.
135+
if has_key(getbufinfo(a:bufnr)[0], 'linecount')
136+
if l:line == getbufinfo(a:bufnr)[0].linecount + 1
137+
let l:line = l:line - 1
138+
endif
136139
endif
137140

138141
if has_key(l:item, 'severity') && !empty(l:item['severity'])

0 commit comments

Comments
 (0)