mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 03:08:13 +00:00
fix(win): don't force close modified buffers
This commit is contained in:
parent
b813c3383c
commit
d517b11cab
1 changed files with 8 additions and 0 deletions
|
@ -218,6 +218,14 @@ function M:close(opts)
|
|||
|
||||
local win = self.win
|
||||
local buf = wipe and self.buf
|
||||
|
||||
-- never close modified buffers
|
||||
if buf and vim.bo[buf].modified then
|
||||
if not pcall(vim.api.nvim_buf_delete, buf, { force = false }) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
self.win = nil
|
||||
if buf then
|
||||
self.buf = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue