diff options
author | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-04-25 21:58:35 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 14:58:35 +0200 |
commit | 78d58eaf61b361ed9b2849ecc1afc99897c01058 (patch) | |
tree | d93e0aac5512535518d01d8fadbdc61fe8dbf169 /runtime/lua/vim/lsp/util.lua | |
parent | c9f4cac3c9ae328156f72d7b61b4490e9ecc754c (diff) | |
download | rneovim-78d58eaf61b361ed9b2849ecc1afc99897c01058.tar.gz rneovim-78d58eaf61b361ed9b2849ecc1afc99897c01058.tar.bz2 rneovim-78d58eaf61b361ed9b2849ecc1afc99897c01058.zip |
lsp: remove buffer version on buffer_detach (#12029)
When we save the buffer, the buffer is detached and attached again.
So the client also needs to remove the buffer version once.
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index ce5baf5b4b..4c73bf8c5f 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -134,8 +134,7 @@ end 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) - -- TODO(ashkan) check this is correct. - if (M.buf_versions[bufnr] or 0) > text_document.version then + if M.buf_versions[bufnr] > text_document.version then print("Buffer ", text_document.uri, " newer than edits.") return end |