refactor(#2942): style
This commit is contained in:
parent
df94463e76
commit
2c1bb3b65a
@ -578,7 +578,6 @@ end
|
|||||||
---@return Node|nil
|
---@return Node|nil
|
||||||
---@return number|nil
|
---@return number|nil
|
||||||
function Explorer:get_node_from_path(path)
|
function Explorer:get_node_from_path(path)
|
||||||
|
|
||||||
if self.absolute_path == path then
|
if self.absolute_path == path then
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -604,7 +603,6 @@ end
|
|||||||
---If node is nil do nothing.
|
---If node is nil do nothing.
|
||||||
---@param node Node? node to focus
|
---@param node Node? node to focus
|
||||||
function Explorer:focus_node_or_parent(node)
|
function Explorer:focus_node_or_parent(node)
|
||||||
|
|
||||||
while node do
|
while node do
|
||||||
local found_node, i = self:find_node(function(node_)
|
local found_node, i = self:find_node(function(node_)
|
||||||
return node_.absolute_path == node.absolute_path
|
return node_.absolute_path == node.absolute_path
|
||||||
@ -626,11 +624,11 @@ end
|
|||||||
---@return number
|
---@return number
|
||||||
function Explorer:find_node(fn)
|
function Explorer:find_node(fn)
|
||||||
local node, i = Iterator.builder(self.nodes)
|
local node, i = Iterator.builder(self.nodes)
|
||||||
:matcher(fn)
|
:matcher(fn)
|
||||||
:recursor(function(node)
|
:recursor(function(node)
|
||||||
return node.group_next and { node.group_next } or (node.open and #node.nodes > 0 and node.nodes)
|
return node.group_next and { node.group_next } or (node.open and #node.nodes > 0 and node.nodes)
|
||||||
end)
|
end)
|
||||||
:iterate()
|
:iterate()
|
||||||
i = view.is_root_folder_visible() and i or i - 1
|
i = view.is_root_folder_visible() and i or i - 1
|
||||||
if node and node.explorer.live_filter.filter then
|
if node and node.explorer.live_filter.filter then
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user