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>
This commit is contained in:
parent
721f69c4af
commit
2f6d1d3c88
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue