From 5e81ae8379c415ac7c8d4ca8856ac33056ee7585 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Wed, 17 Aug 2022 21:15:23 +0530 Subject: [PATCH] utils: close_buffer: Ask for confirmation when using on modified files neovim handles this internally so why not use it --- lua/core/utils.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/core/utils.lua b/lua/core/utils.lua index 243664c..7d4fd2c 100644 --- a/lua/core/utils.lua +++ b/lua/core/utils.lua @@ -6,12 +6,10 @@ local merge_tb = vim.tbl_deep_extend M.close_buffer = function(bufnr) if vim.bo.buftype == "terminal" then vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide") - elseif vim.bo.modified then - print "save the file bruh" else bufnr = bufnr or api.nvim_get_current_buf() require("core.utils").tabuflinePrev() - vim.cmd("bd" .. bufnr) + vim.cmd("silent! confirm bd" .. bufnr) end end