Skip to content

Commit e0961e4

Browse files
committed
feat: expand under node if node is directory
1 parent 447f395 commit e0961e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ local function expand(node)
1111
end
1212

1313
local function iterate(_node)
14+
if _node.parent and _node.nodes and not _node.open then
15+
expand(_node)
16+
end
17+
1418
for _, node in pairs(_node.nodes) do
1519
if node.nodes and not node.open then
1620
expand(node)
@@ -22,8 +26,9 @@ local function iterate(_node)
2226
end
2327
end
2428

25-
function M.fn()
26-
iterate(core.get_explorer())
29+
function M.fn(base_node)
30+
local node = base_node.nodes and base_node or core.get_explorer()
31+
iterate(node)
2732
renderer.draw()
2833
end
2934

0 commit comments

Comments
 (0)