Skip to content

Commit 3e9509e

Browse files
authored
fix(#2088): actions change dir enable false does not update tree root (#2095)
* fix(#2088): update tree root when actions.change_dir disabled * fix(#2088): update tree root when actions.change_dir disabled
1 parent 45400cd commit 3e9509e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/nvim-tree/actions/root/change-dir.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ end
6464

6565
M.force_dirchange = add_profiling_to(function(foldername, should_open_view)
6666
local valid_dir = vim.fn.isdirectory(foldername) == 1 -- prevent problems on non existing dirs
67-
if should_change_dir() and valid_dir then
68-
cd(M.options.global, foldername)
67+
if valid_dir then
68+
if should_change_dir() then
69+
cd(M.options.global, foldername)
70+
end
6971
core.init(foldername)
7072
end
7173

0 commit comments

Comments
 (0)