Add check for server entry in buffer entry. (#1548)

This commit is contained in:
Rodrigo Goya
2024-07-20 07:59:14 +02:00
committed by GitHub
parent e05c42fbf0
commit 6b7aabde99

View File

@@ -750,7 +750,7 @@ function! s:text_changes(buf, server_name) abort
endif
" When syncKind is Incremental and previous content is saved.
if l:sync_kind == 2 && has_key(s:file_content, a:buf)
if l:sync_kind == 2 && has_key(s:file_content, a:buf) && has_key(s:file_content[a:buf], a:server_name)
" compute diff
let l:old_content = s:get_last_file_content(a:buf, a:server_name)
let l:new_content = lsp#utils#buffer#_get_lines(a:buf)