fix(#2057): update focused file on new terminal (#2060)

* Fixing #2057

* Update change-dir.lua

* Fixing error in force_dir_change
This commit is contained in:
EliasGill 2023-03-25 00:50:22 -03:00 committed by GitHub
parent aa9971768a
commit 31d8e24460
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,12 +63,12 @@ local function add_profiling_to(f)
end
M.force_dirchange = add_profiling_to(function(foldername, should_open_view)
if should_change_dir() then
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)
core.init(foldername)
end
core.init(foldername)
if should_open_view then
require("nvim-tree.lib").open()
else