File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ function M.change_root(filepath, bufnr)
41
41
-- test if in vim_cwd
42
42
if utils .path_relative (filepath , vim_cwd ) ~= filepath then
43
43
if vim_cwd ~= cwd then
44
- lib . open (vim_cwd )
44
+ change_dir . fn (vim_cwd )
45
45
end
46
46
return
47
47
end
@@ -52,19 +52,19 @@ function M.change_root(filepath, bufnr)
52
52
53
53
-- otherwise test M.init_root
54
54
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 )
56
56
return
57
57
end
58
58
-- otherwise root_dirs
59
59
for _ , dir in pairs (_config .root_dirs ) do
60
60
dir = vim .fn .fnamemodify (dir , " :p" )
61
61
if utils .path_relative (filepath , dir ) ~= filepath then
62
- lib . open (dir )
62
+ change_dir . fn (dir )
63
63
return
64
64
end
65
65
end
66
66
-- 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" ))
68
68
end
69
69
70
70
--- @deprecated
You can’t perform that action at this time.
0 commit comments