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
This commit is contained in:
Alexander Courtis 2023-04-03 13:07:11 +10:00 committed by GitHub
parent 45400cd7e0
commit 3e9509ec1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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