fix: correct index in movement actions (#1058)
This commit is contained in:
committed by
GitHub
parent
08c57660a7
commit
d5a12ac9db
@@ -56,7 +56,9 @@ function M.parent_node(should_close)
|
||||
parent.open = false
|
||||
altered_tree = true
|
||||
end
|
||||
line = view.View.hide_root_folder and line - 1 or line
|
||||
if not view.is_root_folder_visible(TreeExplorer) then
|
||||
line = line - 1
|
||||
end
|
||||
view.set_cursor { line, 0 }
|
||||
end
|
||||
|
||||
@@ -107,6 +109,9 @@ function M.sibling(direction)
|
||||
local target_node = parent.nodes[index]
|
||||
|
||||
line, _ = get_line_from_node(target_node)(TreeExplorer.nodes, true)
|
||||
if not view.is_root_folder_visible(TreeExplorer) then
|
||||
line = line - 1
|
||||
end
|
||||
view.set_cursor { line, 0 }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user