refactor(#2826): multi instance nvim-tree.view
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
local log = require "nvim-tree.log"
|
||||
local view = require "nvim-tree.view"
|
||||
local utils = require "nvim-tree.utils"
|
||||
local renderer = require "nvim-tree.renderer"
|
||||
local reload = require "nvim-tree.explorer.reload"
|
||||
@@ -13,7 +12,8 @@ local running = {}
|
||||
---Find a path in the tree, expand it and focus it
|
||||
---@param path string relative or absolute
|
||||
function M.fn(path)
|
||||
if not core.get_explorer() or not view.is_visible() then
|
||||
local explorer = core.get_explorer()
|
||||
if not explorer or not explorer.view:is_visible() then
|
||||
return
|
||||
end
|
||||
|
||||
@@ -75,9 +75,9 @@ function M.fn(path)
|
||||
end)
|
||||
:iterate()
|
||||
|
||||
if found and view.is_visible() then
|
||||
if found and explorer.view:is_visible() then
|
||||
renderer.draw()
|
||||
view.set_cursor { line, 0 }
|
||||
explorer.view:set_cursor { line, 0 }
|
||||
end
|
||||
|
||||
running[path_real] = false
|
||||
|
||||
Reference in New Issue
Block a user