From 600aa849f3f61d790e9ecad7c37bfbbad59f10e2 Mon Sep 17 00:00:00 2001 From: kiyan Date: Tue, 22 Feb 2022 00:09:12 +0100 Subject: [PATCH] fix(auto_close): do not close when buffer is modified --- lua/nvim-tree.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 297b0b94..09e6c4d9 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -130,7 +130,8 @@ M.resize = view.resize local function should_abort_auto_close() local buf = api.nvim_get_current_buf() local buftype = api.nvim_buf_get_option(buf, 'ft') - return buftype:match('Telescope') ~= nil + local modified = api.nvim_buf_get_option(buf, 'modified') + return modified or buftype:match('Telescope') ~= nil end function M.auto_close()