refactor(#2826): split global View and instance Window
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
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,7 +42,7 @@ function M.fn(opts)
|
||||
end
|
||||
|
||||
local explorer = core.get_explorer()
|
||||
if explorer and explorer.window:is_visible() then
|
||||
if explorer and view.is_visible() then
|
||||
-- focus
|
||||
if opts.focus then
|
||||
lib.set_target_win()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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 = {}
|
||||
@@ -25,7 +26,7 @@ function M.fn(opts)
|
||||
|
||||
local explorer = core.get_explorer()
|
||||
|
||||
if explorer and explorer.window:is_visible() then
|
||||
if explorer and view.is_visible() then
|
||||
-- focus
|
||||
lib.set_target_win()
|
||||
explorer.window:focus()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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 = {}
|
||||
@@ -42,7 +43,7 @@ function M.fn(opts, no_focus, cwd, bang)
|
||||
opts.path = nil
|
||||
end
|
||||
|
||||
if explorer and explorer.window:is_visible() then
|
||||
if explorer and view.is_visible() then
|
||||
-- close
|
||||
explorer.window:close()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user