fix: do not update cwd when changing window

This commit is contained in:
kiyan
2022-02-14 19:43:57 +01:00
parent ac3f02a83e
commit ad2802d9c4

View File

@@ -14,7 +14,7 @@ function M.fn(name, with_open)
local foldername = name == '..' and vim.fn.fnamemodify(utils.path_remove_trailing(TreeExplorer.cwd), ':h') or name
local no_cwd_change = vim.fn.expand(foldername) == TreeExplorer.cwd
local new_tab = a.nvim_get_current_tabpage()
local is_window = vim.v.event.scope == "window" and new_tab == M.current_tab
local is_window = (vim.v.event.scope == "window" or vim.v.event.changed_window) and new_tab == M.current_tab
if no_cwd_change or is_window then
return
end