Fix warnings
This commit is contained in:
parent
c1948cbce0
commit
641f125f6b
@ -48,11 +48,16 @@ end
|
|||||||
---@return boolean
|
---@return boolean
|
||||||
local function should_expand(expansion_count, node, should_descend)
|
local function should_expand(expansion_count, node, should_descend)
|
||||||
local dir = node:as(DirectoryNode)
|
local dir = node:as(DirectoryNode)
|
||||||
return dir and not dir.open and should_descend(expansion_count, node)
|
if not dir then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return not dir.open and should_descend(expansion_count, node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---@param should_descend fun(expansion_count: integer, node: Node): boolean
|
---@param should_descend fun(expansion_count: integer, node: Node): boolean
|
||||||
|
---@return fun(node): any
|
||||||
local function gen_iterator(should_descend)
|
local function gen_iterator(should_descend)
|
||||||
local expansion_count = 0
|
local expansion_count = 0
|
||||||
|
|
||||||
|
|||||||
@ -232,16 +232,16 @@ Api.tree.collapse_all = wrap(actions.tree.modifiers.collapse.all)
|
|||||||
Api.tree.expand_all = wrap_node(actions.tree.modifiers.expand.all)
|
Api.tree.expand_all = wrap_node(actions.tree.modifiers.expand.all)
|
||||||
|
|
||||||
Api.tree.toggle_descend_until = wrap_node(function(node, descend_until)
|
Api.tree.toggle_descend_until = wrap_node(function(node, descend_until)
|
||||||
if node.open then
|
|
||||||
local dir = node:as(DirectoryNode)
|
local dir = node:as(DirectoryNode)
|
||||||
dir:expand_or_collapse("edit")
|
if dir then
|
||||||
|
if node.open then
|
||||||
|
dir:expand_or_collapse(nil)
|
||||||
else
|
else
|
||||||
if node.nodes then
|
|
||||||
actions.tree.modifiers.expand.all(node, { descend_until = descend_until })
|
actions.tree.modifiers.expand.all(node, { descend_until = descend_until })
|
||||||
|
end
|
||||||
else
|
else
|
||||||
edit("edit", node)
|
edit("edit", node)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Api.tree.toggle_enable_filters = wrap_explorer_member("filters", "toggle")
|
Api.tree.toggle_enable_filters = wrap_explorer_member("filters", "toggle")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user