refacto: set tree explorer in the global state
also remove the redraw method and use renderer.draw immediately
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user