We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
close_node
1 parent 08d7cc9 commit 74040b3Copy full SHA for 74040b3
lua/neo-tree/sources/common/commands.lua
@@ -147,7 +147,10 @@ M.close_node = function(state, callback)
147
target_node = parent_node
148
end
149
150
- if target_node and target_node:has_children() then
+ local root = tree:get_nodes()[1]
151
+ local is_root = target_node:get_id() == root:get_id()
152
+
153
+ if target_node and target_node:has_children() and not is_root then
154
target_node:collapse()
155
renderer.redraw(state)
156
renderer.focus_node(state, target_node:get_id())
0 commit comments