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

@@ -1,3 +1,4 @@
local view = require("nvim-tree.view")
local utils = require("nvim-tree.utils")
local DirectoryNode = require("nvim-tree.node.directory")
@@ -24,7 +25,7 @@ function M.fn(should_close)
local parent = (node:get_parent_of_group() or node).parent
if not parent or not parent.parent then
node.explorer.window:set_cursor({ 1, 0 })
view.set_cursor({ 1, 0 })
return
end
@@ -32,7 +33,7 @@ function M.fn(should_close)
return n.absolute_path == parent.absolute_path
end)
node.explorer.window:set_cursor({ line + 1, 0 })
view.set_cursor({ line + 1, 0 })
if should_close then
parent.open = false
parent.explorer.renderer:draw()