utils: close_buffer: Ask for confirmation when using on modified files
neovim handles this internally so why not use it
This commit is contained in:
parent
ce86597c3d
commit
5e81ae8379
@ -6,12 +6,10 @@ local merge_tb = vim.tbl_deep_extend
|
|||||||
M.close_buffer = function(bufnr)
|
M.close_buffer = function(bufnr)
|
||||||
if vim.bo.buftype == "terminal" then
|
if vim.bo.buftype == "terminal" then
|
||||||
vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide")
|
vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide")
|
||||||
elseif vim.bo.modified then
|
|
||||||
print "save the file bruh"
|
|
||||||
else
|
else
|
||||||
bufnr = bufnr or api.nvim_get_current_buf()
|
bufnr = bufnr or api.nvim_get_current_buf()
|
||||||
require("core.utils").tabuflinePrev()
|
require("core.utils").tabuflinePrev()
|
||||||
vim.cmd("bd" .. bufnr)
|
vim.cmd("silent! confirm bd" .. bufnr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user