From 3e9509ec1b86f2352af85dd87ed77200488471b6 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 3 Apr 2023 13:07:11 +1000 Subject: [PATCH] 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 --- lua/nvim-tree/actions/root/change-dir.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/nvim-tree/actions/root/change-dir.lua b/lua/nvim-tree/actions/root/change-dir.lua index b779c01f..0e667330 100644 --- a/lua/nvim-tree/actions/root/change-dir.lua +++ b/lua/nvim-tree/actions/root/change-dir.lua @@ -64,8 +64,10 @@ end M.force_dirchange = add_profiling_to(function(foldername, should_open_view) local valid_dir = vim.fn.isdirectory(foldername) == 1 -- prevent problems on non existing dirs - if should_change_dir() and valid_dir then - cd(M.options.global, foldername) + if valid_dir then + if should_change_dir() then + cd(M.options.global, foldername) + end core.init(foldername) end