Skip to content

fix(#2433): selection incorrect after find-file when renderer.group_empty #2437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lua/nvim-tree/actions/finders/find-file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ function M.fn(path)
return node.absolute_path == path_real or node.link_to == path_real
end)
:applier(function(node)
local incremented_line = false
if not node.group_next then
line = line + 1
incremented_line = true
end

if vim.tbl_contains(absolute_paths_searched, node.absolute_path) then
Expand All @@ -62,6 +64,9 @@ function M.fn(path)
end
if #node.nodes == 0 then
core.get_explorer():expand(node)
if node.group_next and incremented_line then
line = line - 1
end
end
end
end)
Expand Down