Skip to content

Commit 307ead2

Browse files
committed
tidy group methods
1 parent d5e018a commit 307ead2

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lua/nvim-tree/node/directory.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,7 @@ end
135135
-- If node is grouped, return the last node in the group. Otherwise, return the given node.
136136
---@return Node
137137
function DirectoryNode:last_group_node()
138-
local node = self
139-
140-
while node.group_next do
141-
node = node.group_next or node
142-
end
143-
144-
return node
138+
return self.group_next and self.group_next:last_group_node() or self
145139
end
146140

147141
---Return the one and only one child directory

0 commit comments

Comments
 (0)