From 6dc8398944fd86038b07d77fcab92cd282555dee Mon Sep 17 00:00:00 2001 From: ckipp01 Date: Mon, 27 Apr 2020 10:55:06 +0200 Subject: [LSP] check for vim.NIL and add apply_text_document_edit tests --- runtime/lua/vim/lsp/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim/lsp') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 68f3b35df3..82b9a0b3aa 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -160,7 +160,7 @@ function M.apply_text_document_edit(text_document_edit) local text_document = text_document_edit.textDocument local bufnr = vim.uri_to_bufnr(text_document.uri) -- `VersionedTextDocumentIdentifier`s version may be nil https://microsoft.github.io/language-server-protocol/specification#versionedTextDocumentIdentifier - if text_document.version ~= nil and M.buf_versions[bufnr] > text_document.version then + if text_document.version ~= vim.NIL and M.buf_versions[bufnr] > text_document.version then print("Buffer ", text_document.uri, " newer than edits.") return end -- cgit