chore: add guards to prepare setup refactoring

This commit is contained in:
kiyan
2022-02-11 11:06:11 +01:00
parent 0708a1c551
commit 0f7da146bf
5 changed files with 10 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ end
local event_running = false
function M.reload_explorer(callback)
if event_running or not TreeExplorer.cwd or vim.v.exiting ~= vim.NIL then
if event_running or not TreeExplorer or not TreeExplorer.cwd or vim.v.exiting ~= vim.NIL then
return
end
event_running = true
@@ -52,7 +52,7 @@ function M.reload_explorer(callback)
end
function M.reload_git()
if not git.config.enable or event_running then
if not TreeExplorer or not git.config.enable or event_running then
return
end
event_running = true