refactor(#2826): View is an Explorer member
This commit is contained in:
@@ -1,6 +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 = {}
|
||||
@@ -41,11 +40,12 @@ function M.fn(opts)
|
||||
return
|
||||
end
|
||||
|
||||
if view.View:is_visible() then
|
||||
local explorer = core.get_explorer()
|
||||
if explorer and explorer.view:is_visible() then
|
||||
-- focus
|
||||
if opts.focus then
|
||||
lib.set_target_win()
|
||||
view.View:focus()
|
||||
explorer.view:focus()
|
||||
end
|
||||
elseif opts.open then
|
||||
-- open
|
||||
|
||||
Reference in New Issue
Block a user