fix(watcher): only purge on subsequent setup calls, add git_purge log
This commit is contained in:
parent
0cd8ac4751
commit
899ed45602
@ -794,20 +794,19 @@ function M.setup(conf)
|
|||||||
end
|
end
|
||||||
|
|
||||||
setup_autocommands(opts)
|
setup_autocommands(opts)
|
||||||
require("nvim-tree.watcher").purge_watchers()
|
|
||||||
|
|
||||||
if not M.setup_called then
|
if not M.setup_called then
|
||||||
|
-- first call to setup
|
||||||
setup_vim_commands()
|
setup_vim_commands()
|
||||||
end
|
else
|
||||||
|
-- subsequent calls to setup
|
||||||
if M.setup_called then
|
require("nvim-tree.watcher").purge_watchers()
|
||||||
view.close_all_tabs()
|
view.close_all_tabs()
|
||||||
view.abandon_all_windows()
|
view.abandon_all_windows()
|
||||||
end
|
if core.get_explorer() ~= nil then
|
||||||
|
git.purge_state()
|
||||||
if M.setup_called and core.get_explorer() ~= nil then
|
TreeExplorer = nil
|
||||||
git.purge_state()
|
end
|
||||||
TreeExplorer = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
M.setup_called = true
|
M.setup_called = true
|
||||||
|
|||||||
@ -173,6 +173,7 @@ function M.load_project_status(cwd)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.purge_state()
|
function M.purge_state()
|
||||||
|
log.line("git", "purge_state")
|
||||||
M.projects = {}
|
M.projects = {}
|
||||||
M.cwd_to_project_root = {}
|
M.cwd_to_project_root = {}
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user