Skip to content

Commit

Permalink
fix: no error if opening file that has swapfile
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 20, 2023
1 parent adff3b9 commit a60639d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/oil/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a60639d

Please sign in to comment.