refactor(#2826): split global View and instance Window

This commit is contained in:
Alexander Courtis
2025-06-16 16:11:06 +10:00
parent 54439447f1
commit 8b9c9c107f
17 changed files with 282 additions and 261 deletions

View File

@@ -543,10 +543,7 @@ function M.focus_file(path)
local _, i = M.find_node(require("nvim-tree.core").get_explorer().nodes, function(node)
return node.absolute_path == path
end)
local explorer = require("nvim-tree.core").get_explorer()
if explorer then
explorer.window:set_cursor({ i + 1, 1 })
end
require("nvim-tree.view").set_cursor({ i + 1, 1 })
end
---Focus node passed as parameter if visible, otherwise focus first visible parent.
@@ -566,7 +563,7 @@ function M.focus_node_or_parent(node)
end)
if found_node or node.parent == nil then
explorer.window:set_cursor({ i + 1, 1 })
require("nvim-tree.view").set_cursor({ i + 1, 1 })
break
end