fix(install): avoid data-races for on_packer_complete (#2157)

This commit is contained in:
kylo252 2022-01-10 09:54:47 +01:00 committed by GitHub
parent 66e8facb15
commit ec1e4140fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 19 deletions

View file

@ -43,7 +43,9 @@ function plugin_loader.init(opts)
},
}
vim.cmd [[autocmd User PackerComplete lua require('lvim.utils.hooks').run_on_packer_complete()]]
if not in_headless then
vim.cmd [[autocmd User PackerComplete lua require('lvim.utils.hooks').run_on_packer_complete()]]
end
end
-- packer expects a space separated list
@ -113,7 +115,6 @@ function plugin_loader.sync_core_plugins()
end
function plugin_loader.ensure_installed()
plugin_loader.cache_clear()
local all_plugins = _G.packer_plugins or plugin_loader.get_core_plugins()
Log:trace(string.format("Syncing core plugins: [%q]", table.concat(all_plugins, ", ")))
pcall_packer_command("install", all_plugins)