refactor(#2826): View is an Explorer member

This commit is contained in:
Alexander Courtis
2025-04-21 12:02:19 +10:00
parent 0eb21f66f7
commit 44cb3d2f0a
21 changed files with 170 additions and 114 deletions

View File

@@ -1,5 +1,5 @@
local core = require("nvim-tree.core")
local lib = require("nvim-tree.lib")
local view = require("nvim-tree.view")
local finders_find_file = require("nvim-tree.actions.finders.find-file")
local M = {}
@@ -23,10 +23,12 @@ function M.fn(opts)
opts.path = nil
end
if view.View:is_visible() then
local explorer = core.get_explorer()
if explorer and explorer.view:is_visible() then
-- focus
lib.set_target_win()
view.View:focus()
explorer.view:focus()
else
-- open
lib.open({