refacto: set tree explorer in the global state

also remove the redraw method and use renderer.draw immediately
This commit is contained in:
kiyan
2022-02-07 22:07:08 +01:00
parent e42a4337d0
commit ea92e7bf7c
18 changed files with 85 additions and 93 deletions

View File

@@ -4,7 +4,7 @@ function M.fn(node)
if not node or node.name == ".." then
return require'nvim-tree.actions.change-dir'.fn('..')
else
local newdir = vim.fn.fnamemodify(require'nvim-tree.lib'.Tree.cwd, ':h')
local newdir = vim.fn.fnamemodify(TreeExplorer.cwd, ':h')
require'nvim-tree.actions.change-dir'.fn(newdir)
return require"nvim-tree.actions.find-file".fn(node.absolute_path)
end