File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
lua/nvim-tree/actions/tree/modifiers Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,13 @@ local function populate_node(node)
24
24
if node .nodes == nil then
25
25
return
26
26
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
-
34
27
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 )
35
34
core .get_explorer ():expand (node , status )
36
35
end
37
36
end
@@ -51,6 +50,7 @@ local function gen_iterator(should_expand_fn)
51
50
local expansion_count = 0
52
51
53
52
return function (parent )
53
+ populate_node (parent )
54
54
parent .open = true
55
55
56
56
Iterator .builder ({ parent })
@@ -60,6 +60,7 @@ local function gen_iterator(should_expand_fn)
60
60
should_expand_fn = should_expand_next_fn
61
61
if should_expand then
62
62
expansion_count = expansion_count + 1
63
+ populate_node (node )
63
64
node = lib .get_last_group_node (node )
64
65
node .open = true
65
66
end
You can’t perform that action at this time.
0 commit comments