fix(win): force-close any buffer that is not a file

This commit is contained in:
Folke Lemaitre 2024-12-31 06:03:48 +01:00
parent ca233c7448
commit dd50e53a9e
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -265,7 +265,7 @@ function M:close(opts)
local buf = wipe and self.buf
-- never close modified buffers
if buf and vim.bo[buf].modified then
if buf and vim.bo[buf].modified and vim.bo[buf].buftype == "" then
if not pcall(vim.api.nvim_buf_delete, buf, { force = false }) then
return
end