diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-10-16 13:38:29 +0100 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-10-17 12:52:45 +0100 |
commit | e954a16063e61c2c16f2a17885ab8377e07d4e2f (patch) | |
tree | 40a8cb5c12464086ee764642838d92140e93e775 /runtime/lua/vim/lsp/util.lua | |
parent | 97119a236937f47dab2d16321ce062b653bf3f2c (diff) | |
download | rneovim-e954a16063e61c2c16f2a17885ab8377e07d4e2f.tar.gz rneovim-e954a16063e61c2c16f2a17885ab8377e07d4e2f.tar.bz2 rneovim-e954a16063e61c2c16f2a17885ab8377e07d4e2f.zip |
feat(lsp.util): remove some variables
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 4953cb0fbc..e0e93678e2 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -510,17 +510,12 @@ function M.apply_text_document_edit(text_document_edit, index, offset_encoding) return end - -- For lists of text document edits, - -- do not check the version after the first edit. - local should_check_version = true - if index and index > 1 then - should_check_version = false - end - -- `VersionedTextDocumentIdentifier`s version may be null -- https://microsoft.github.io/language-server-protocol/specification#versionedTextDocumentIdentifier if - should_check_version + -- For lists of text document edits, + -- do not check the version after the first edit. + not (index and index > 1) and ( text_document.version and text_document.version > 0 @@ -2179,9 +2174,7 @@ function M._refresh(method, opts) local textDocument = M.make_text_document_params(bufnr) - local only_visible = opts.only_visible or false - - if only_visible then + if opts.only_visible then for _, window in ipairs(api.nvim_list_wins()) do if api.nvim_win_get_buf(window) == bufnr then local first = vim.fn.line('w0', window) |