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

@@ -131,7 +131,7 @@ local function update_base_dir_with_filepath(filepath, bufnr)
end
end
if not vim.startswith(filepath, lib.Tree.cwd or vim.loop.cwd()) then
if not vim.startswith(filepath, TreeExplorer.cwd or vim.loop.cwd()) then
ChangeDir.fn(vim.fn.fnamemodify(filepath, ':p:h'))
end
end
@@ -190,7 +190,7 @@ function M.open_on_directory()
end
view.close()
if bufname ~= lib.Tree.cwd then
if bufname ~= TreeExplorer.cwd then
ChangeDir.fn(bufname)
end
M.hijack_current_window()