aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorStephan Seitz <stephan.lauf@yahoo.de>2020-06-11 21:47:03 +0200
committerGitHub <noreply@github.com>2020-06-11 15:47:03 -0400
commitb751d16cadfc3d2c7e7958432956859b3e2482fa (patch)
tree9a3f5bc2d0d3a621bb7fbca2966b076aca2104bc /runtime/lua/vim
parente78658348d2b14f2366b9baf2f7ceed19184dbb6 (diff)
downloadrneovim-b751d16cadfc3d2c7e7958432956859b3e2482fa.tar.gz
rneovim-b751d16cadfc3d2c7e7958432956859b3e2482fa.tar.bz2
rneovim-b751d16cadfc3d2c7e7958432956859b3e2482fa.zip
lsp: Fix #12449 textDocumentSync.save can be boolean. Access textDocumentSync.save.includeText only if table. (#12450)
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/lsp/protocol.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index 64911fe7bb..4fded1961d 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -897,7 +897,8 @@ function protocol.resolve_capabilities(server_capabilities)
text_document_will_save = ifnil(textDocumentSync.willSave, false);
text_document_will_save_wait_until = ifnil(textDocumentSync.willSaveWaitUntil, false);
text_document_save = ifnil(textDocumentSync.save, false);
- text_document_save_include_text = ifnil(textDocumentSync.save and textDocumentSync.save.includeText, false);
+ text_document_save_include_text = ifnil(type(textDocumentSync.save) == 'table'
+ and textDocumentSync.save.includeText, false);
}
else
return nil, string.format("Invalid type for textDocumentSync: %q", type(textDocumentSync))