Skip to content

Commit 4a971bf

Browse files
committed
fix current dir still open
1 parent 6f2c764 commit 4a971bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lua/nvim-tree/actions/tree/modifiers/collapse.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ function M.collapse(opts)
3939

4040
local selected_nodes
4141
if opts.under_cursor then
42+
local dir = node:as(DirectoryNode)
4243
if not node or not node.nodes then
4344
return
4445
end
4546
selected_nodes = node.nodes
47+
dir.open = false
4648
else
4749
selected_nodes = explorer.nodes
4850
end

0 commit comments

Comments
 (0)