fix(util): use bdelete for buf remove

This commit is contained in:
Folke Lemaitre 2024-05-17 15:49:48 +02:00
parent c8b7912eb9
commit 19674e8047
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -246,7 +246,9 @@ function M.bufremove(buf)
vim.api.nvim_win_set_buf(win, new_buf) vim.api.nvim_win_set_buf(win, new_buf)
end) end)
end end
vim.api.nvim_buf_delete(buf, { force = true }) if vim.api.nvim_buf_is_valid(buf) then
pcall(vim.cmd, "bdelete! " .. buf)
end
end end
return M return M