Skip to content

Commit 570b905

Browse files
committed
refactor(#2942): multi instance: move get_node_from_path to Explorer
1 parent f030ea6 commit 570b905

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

lua/nvim-tree/utils.lua

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -149,39 +149,6 @@ function M.extmarks_length(extmarks)
149149
return length
150150
end
151151

152-
-- get the node in the tree state depending on the absolute path of the node
153-
-- (grouped or hidden too)
154-
---@param path string
155-
---@return Node|nil
156-
---@return number|nil
157-
function M.get_node_from_path(path)
158-
local explorer = require("nvim-tree.core").get_explorer()
159-
160-
-- tree may not yet be loaded
161-
if not explorer then
162-
return
163-
end
164-
165-
if explorer.absolute_path == path then
166-
return explorer
167-
end
168-
169-
return Iterator.builder(explorer.nodes)
170-
:hidden()
171-
:matcher(function(node)
172-
return node.absolute_path == path or node.link_to == path
173-
end)
174-
:recursor(function(node)
175-
if node.group_next then
176-
return { node.group_next }
177-
end
178-
if node.nodes then
179-
return node.nodes
180-
end
181-
end)
182-
:iterate()
183-
end
184-
185152
M.default_format_hidden_count = function(hidden_count, simple)
186153
local parts = {}
187154
local total_count = 0

0 commit comments

Comments
 (0)