From 3b9d4c6cf23737ce848af11042d55b2c6a6126c4 Mon Sep 17 00:00:00 2001 From: doongjohn Date: Fri, 2 Aug 2024 15:45:58 +0900 Subject: [PATCH 1/2] Clear the active session on `delete_current_dir_session` --- lua/session_manager/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/session_manager/init.lua b/lua/session_manager/init.lua index 6070afe..3b1c217 100644 --- a/lua/session_manager/init.lua +++ b/lua/session_manager/init.lua @@ -139,6 +139,11 @@ function session_manager.delete_current_dir_session() local session = config.dir_to_session_filename(cwd) if session:exists() then utils.delete_session(session) + + -- Clear the active session filename if deleted. + if session.filename == utils.active_session_filename then + utils.active_session_filename = nil + end end end end From 09a8d7a9375168f78024742f6f7dc106e9f440a6 Mon Sep 17 00:00:00 2001 From: doongjohn Date: Fri, 2 Aug 2024 16:40:58 +0900 Subject: [PATCH 2/2] update delete_current_dir_session delete_session param --- lua/session_manager/init.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lua/session_manager/init.lua b/lua/session_manager/init.lua index 3b1c217..df52fc6 100644 --- a/lua/session_manager/init.lua +++ b/lua/session_manager/init.lua @@ -138,12 +138,7 @@ function session_manager.delete_current_dir_session() if cwd then local session = config.dir_to_session_filename(cwd) if session:exists() then - utils.delete_session(session) - - -- Clear the active session filename if deleted. - if session.filename == utils.active_session_filename then - utils.active_session_filename = nil - end + utils.delete_session(session.filename) end end end