We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cbaebd9 commit ce43f2eCopy full SHA for ce43f2e
lua/session_manager/init.lua
@@ -67,6 +67,17 @@ function session_manager.load_current_dir_session(discard_current)
67
return false
68
end
69
70
+--- Checks if a session for the current working directory exists.
71
+---@return boolean: `true` if session was found, `false` otherwise.
72
+function session_manager.current_dir_session_exists()
73
+ local cwd = vim.uv.cwd()
74
+ if cwd then
75
+ local session = config.dir_to_session_filename(cwd)
76
+ return session:exists()
77
+ end
78
+ return false
79
+end
80
+
81
--- If in a git repo, tries to load a session for the repo's root directory
82
---@return boolean: `true` if session was loaded, `false` otherwise.
83
function session_manager.load_git_session(discard_current)
0 commit comments