Add a config option to use :cd instead of :lcd (#874)

Fixes #829
This commit is contained in:
Sander van Harmelen
2022-01-21 12:29:30 +01:00
committed by GitHub
parent 14461373e0
commit 1ac3502290
3 changed files with 10 additions and 2 deletions

View File

@@ -274,7 +274,11 @@ function M.change_dir(name)
end
current_tab = new_tab
vim.cmd('lcd '..vim.fn.fnameescape(foldername))
if vim.g.nvim_tree_change_dir_global == 1 then
vim.cmd('cd '..vim.fn.fnameescape(foldername))
else
vim.cmd('lcd '..vim.fn.fnameescape(foldername))
end
M.init(false, foldername)
end