Skip to content

Commit a3f1588

Browse files
committed
Call populate_node in case it wasn't called by the user
1 parent 4510332 commit a3f1588

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lua/nvim-tree/actions/tree/modifiers/expand-all.lua

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ local function populate_node(node)
2424
if node.nodes == nil then
2525
return
2626
end
27-
local cwd = node.link_to or node.absolute_path
28-
local handle = vim.loop.fs_scandir(cwd)
29-
if not handle then
30-
return
31-
end
32-
local status = git.load_project_status(cwd)
33-
3427
if #node.nodes == 0 then
28+
local cwd = node.link_to or node.absolute_path
29+
local handle = vim.loop.fs_scandir(cwd)
30+
if not handle then
31+
return
32+
end
33+
local status = git.load_project_status(cwd)
3534
core.get_explorer():expand(node, status)
3635
end
3736
end
@@ -51,6 +50,7 @@ local function gen_iterator(should_expand_fn)
5150
local expansion_count = 0
5251

5352
return function(parent)
53+
populate_node(parent)
5454
parent.open = true
5555

5656
Iterator.builder({ parent })
@@ -60,6 +60,7 @@ local function gen_iterator(should_expand_fn)
6060
should_expand_fn = should_expand_next_fn
6161
if should_expand then
6262
expansion_count = expansion_count + 1
63+
populate_node(node)
6364
node = lib.get_last_group_node(node)
6465
node.open = true
6566
end

0 commit comments

Comments
 (0)