naming fix for luacheck 0.26.0

This commit is contained in:
Alexander Courtis
2022-03-26 12:29:01 +11:00
parent 7b0ebf8b17
commit 1352cb312c

View File

@@ -99,15 +99,15 @@ end
-- get the node from the tree that matches the predicate -- get the node from the tree that matches the predicate
-- @param nodes list of node -- @param nodes list of node
-- @param fn function(node): boolean -- @param fn function(node): boolean
function M.find_node(_nodes, _fn) function M.find_node(nodes, fn)
local function iter(nodes, fn) local function iter(nodes_, fn_)
local i = 1 local i = 1
for _, node in ipairs(nodes) do for _, node in ipairs(nodes_) do
if fn(node) then if fn_(node) then
return node, i return node, i
end end
if node.open and #node.nodes > 0 then if node.open and #node.nodes > 0 then
local n, idx = iter(node.nodes, fn) local n, idx = iter(node.nodes, fn_)
i = i + idx i = i + idx
if n then if n then
return n, i return n, i
@@ -118,7 +118,7 @@ function M.find_node(_nodes, _fn)
end end
return nil, i return nil, i
end end
local node, i = iter(_nodes, _fn) local node, i = iter(nodes, fn)
i = require("nvim-tree.view").View.hide_root_folder and i - 1 or i i = require("nvim-tree.view").View.hide_root_folder and i - 1 or i
return node, i return node, i
end end