Skip to content

Commit e1fbabf

Browse files
committed
fix init_tree should not run when root path doesnt change
1 parent ab258d9 commit e1fbabf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lua/lib/state.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ function M.set_root_path(path)
1111
ROOT_PATH = path
1212
end
1313

14+
function M.get_root_path()
15+
return ROOT_PATH
16+
end
17+
1418
local Tree = {}
1519

1620
local IGNORE_LIST = ""

lua/tree.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ function M.navigate_to_buffer_dir(bufname)
158158
if new_path ~= '/' then
159159
new_path = new_path .. '/'
160160
end
161+
if new_path == state.get_root_path() then
162+
return
163+
end
161164
set_root_path(new_path)
162165
init_tree()
163166
end

0 commit comments

Comments
 (0)