File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 99
99
-- get the node from the tree that matches the predicate
100
100
-- @param nodes list of node
101
101
-- @param fn function(node): boolean
102
- function M .find_node (_nodes , _fn )
103
- local function iter (nodes , fn )
102
+ function M .find_node (nodes , fn )
103
+ local function iter (nodes_ , fn_ )
104
104
local i = 1
105
- for _ , node in ipairs (nodes ) do
106
- if fn (node ) then
105
+ for _ , node in ipairs (nodes_ ) do
106
+ if fn_ (node ) then
107
107
return node , i
108
108
end
109
109
if node .open and # node .nodes > 0 then
110
- local n , idx = iter (node .nodes , fn )
110
+ local n , idx = iter (node .nodes , fn_ )
111
111
i = i + idx
112
112
if n then
113
113
return n , i
@@ -118,7 +118,7 @@ function M.find_node(_nodes, _fn)
118
118
end
119
119
return nil , i
120
120
end
121
- local node , i = iter (_nodes , _fn )
121
+ local node , i = iter (nodes , fn )
122
122
i = require (" nvim-tree.view" ).View .hide_root_folder and i - 1 or i
123
123
return node , i
124
124
end
You can’t perform that action at this time.
0 commit comments