Skip to content

fix(#2088): actions change dir enable false does not update tree root #2095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lua/nvim-tree/actions/root/change-dir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down