Skip to content

Commit b299a87

Browse files
authored
fix (#1363): use change_dir.fn instead of lib.open in M.change_root
1 parent 65beb55 commit b299a87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/nvim-tree.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function M.change_root(filepath, bufnr)
4141
-- test if in vim_cwd
4242
if utils.path_relative(filepath, vim_cwd) ~= filepath then
4343
if vim_cwd ~= cwd then
44-
lib.open(vim_cwd)
44+
change_dir.fn(vim_cwd)
4545
end
4646
return
4747
end
@@ -52,19 +52,19 @@ function M.change_root(filepath, bufnr)
5252

5353
-- otherwise test M.init_root
5454
if _config.prefer_startup_root and utils.path_relative(filepath, M.init_root) ~= filepath then
55-
lib.open(M.init_root)
55+
change_dir.fn(M.init_root)
5656
return
5757
end
5858
-- otherwise root_dirs
5959
for _, dir in pairs(_config.root_dirs) do
6060
dir = vim.fn.fnamemodify(dir, ":p")
6161
if utils.path_relative(filepath, dir) ~= filepath then
62-
lib.open(dir)
62+
change_dir.fn(dir)
6363
return
6464
end
6565
end
6666
-- finally fall back to the folder containing the file
67-
lib.open(vim.fn.fnamemodify(filepath, ":p:h"))
67+
change_dir.fn(vim.fn.fnamemodify(filepath, ":p:h"))
6868
end
6969

7070
---@deprecated

0 commit comments

Comments
 (0)