aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorfrancisco souza <108725+fsouza@users.noreply.github.com>2020-06-23 11:50:37 -0400
committerGitHub <noreply@github.com>2020-06-23 17:50:37 +0200
commit2f6d1d3c887a87d9402137425b418dd12a904aac (patch)
treec86854be831738fd2bb6468cd7a971eb33879960 /runtime/lua/vim/lsp/util.lua
parent721f69c4af8bc81ba04088e7b56f8cdba653b418 (diff)
downloadrneovim-2f6d1d3c887a87d9402137425b418dd12a904aac.tar.gz
rneovim-2f6d1d3c887a87d9402137425b418dd12a904aac.tar.bz2
rneovim-2f6d1d3c887a87d9402137425b418dd12a904aac.zip
lsp: when apply text edits, set buflisted on buffers (#12489)
The client creates buffers on the fly to be able to apply text edits on files that weren't previously open, which is great, but it uses the bufadd() function, which creates unlisted buffers and can lead to a weird experience in the text editor. Setting the buffer to buflisted fixes this. Closes #12488. Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 71ca1048e1..0f366c2b57 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -119,6 +119,7 @@ function M.apply_text_edits(text_edits, bufnr)
if not api.nvim_buf_is_loaded(bufnr) then
vim.fn.bufload(bufnr)
end
+ api.nvim_buf_set_option(bufnr, 'buflisted', true)
local start_line, finish_line = math.huge, -1
local cleaned = {}
for i, e in ipairs(text_edits) do