Skip to content

Commit 4dcbb67

Browse files
committed
Update getcwd in autocmds.lua to also take two -1,-1 arguments
1 parent 2858a15 commit 4dcbb67

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lua/auto-session/autocmds.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ local function purge_orphaned_sessions()
7979
local session_files = Lib.get_session_list(M.AutoSession.get_root_dir())
8080
for _, session in ipairs(session_files) do
8181
if
82-
not Lib.is_named_session(session.session_name)
83-
-- don't want any annotations (e.g. git branch)
84-
and vim.fn.isdirectory(session.display_name_component) == Lib._VIM_FALSE
82+
not Lib.is_named_session(session.session_name)
83+
-- don't want any annotations (e.g. git branch)
84+
and vim.fn.isdirectory(session.display_name_component) == Lib._VIM_FALSE
8585
then
8686
Lib.logger.debug("purge: " .. session.session_name)
8787
table.insert(orphaned_sessions, session.session_name)
@@ -205,7 +205,7 @@ local function setup_dirchanged_autocmds(AutoSession)
205205
callback = function()
206206
Lib.logger.debug "DirChangedPre"
207207
Lib.logger.debug {
208-
cwd = vim.fn.getcwd(),
208+
cwd = vim.fn.getcwd(-1, -1),
209209
target = vim.v.event.directory,
210210
["changed window"] = tostring(vim.v.event.changed_window),
211211
scope = vim.v.event.scope,
@@ -239,7 +239,7 @@ local function setup_dirchanged_autocmds(AutoSession)
239239
vim.api.nvim_create_autocmd("DirChanged", {
240240
callback = function()
241241
Lib.logger.debug "DirChanged"
242-
Lib.logger.debug(" cwd: " .. vim.fn.getcwd())
242+
Lib.logger.debug(" cwd: " .. vim.fn.getcwd(-1, -1))
243243
Lib.logger.debug(" changed window: " .. tostring(vim.v.event.changed_window))
244244
Lib.logger.debug(" scope: " .. vim.v.event.scope)
245245

0 commit comments

Comments
 (0)