Skip to content

Commit d8e495b

Browse files
authored
fix(#2154): selection incorrect after find-file when renderer.group_empty (#2437)
1 parent e153d9f commit d8e495b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/nvim-tree/actions/finders/find-file.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ function M.fn(path)
4444
return node.absolute_path == path_real or node.link_to == path_real
4545
end)
4646
:applier(function(node)
47+
local incremented_line = false
4748
if not node.group_next then
4849
line = line + 1
50+
incremented_line = true
4951
end
5052

5153
if vim.tbl_contains(absolute_paths_searched, node.absolute_path) then
@@ -62,6 +64,9 @@ function M.fn(path)
6264
end
6365
if #node.nodes == 0 then
6466
core.get_explorer():expand(node)
67+
if node.group_next and incremented_line then
68+
line = line - 1
69+
end
6570
end
6671
end
6772
end)

0 commit comments

Comments
 (0)