Skip to content

Commit 43282b8

Browse files
committed
temporary DirectoryNode casting until method extraction into child classes
1 parent 56ae381 commit 43282b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/nvim-tree/node/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ end
173173
-- If node is grouped, return the last node in the group. Otherwise, return the given node.
174174
---@return Node
175175
function BaseNode:last_group_node()
176-
local node = self
176+
local node = self --[[@as BaseNode]]
177177

178178
while node.group_next do
179179
node = node.group_next
@@ -269,6 +269,7 @@ function BaseNode:group_empty_folders()
269269
local is_root = not self.parent
270270
local child_folder_only = self:has_one_child_folder() and self.nodes[1]
271271
if self.explorer.opts.renderer.group_empty and not is_root and child_folder_only then
272+
---@cast self DirectoryNode -- TODO move this to the class
272273
self.group_next = child_folder_only
273274
local ns = child_folder_only:group_empty_folders()
274275
self.nodes = ns or {}
@@ -291,6 +292,7 @@ end
291292
function BaseNode:expand_or_collapse(toggle_group)
292293
toggle_group = toggle_group or false
293294
if self.has_children then
295+
---@cast self DirectoryNode -- TODO move this to the class
294296
self.has_children = false
295297
end
296298

0 commit comments

Comments
 (0)