fix(lsp): rename: load and list new buffer if attached to window (#27408)

This commit is contained in:
Tomasz N
2024-02-14 21:11:29 +01:00
committed by GitHub
parent a376d979bd
commit d09957e0a0
2 changed files with 64 additions and 0 deletions

View File

@@ -702,6 +702,8 @@ function M.rename(old_fname, new_fname, opts)
if vim.fn.isdirectory(new_fname) == 0 then
local newbuf = vim.fn.bufadd(new_fname)
if win then
vim.fn.bufload(newbuf)
vim.bo[newbuf].buflisted = true
api.nvim_win_set_buf(win, newbuf)
end
end