fix: no error if opening file that has swapfile
This commit is contained in:
parent
adff3b9154
commit
a60639db35
1 changed files with 1 additions and 1 deletions
|
|
@ -112,7 +112,7 @@ M.rename_buffer = function(src_bufnr, dest_buf_name)
|
|||
end
|
||||
|
||||
local dest_bufnr = vim.fn.bufadd(dest_buf_name)
|
||||
vim.fn.bufload(dest_bufnr)
|
||||
pcall(vim.fn.bufload, dest_bufnr)
|
||||
if vim.bo[src_bufnr].buflisted then
|
||||
vim.bo[dest_bufnr].buflisted = true
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue