From 08d3df2cd3515878309906c2791d1b934425d78f Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:16:38 +0100 Subject: feat(plugins): add support for packer snapshots (#2351) --- lua/lvim/utils/hooks.lua | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'lua/lvim/utils/hooks.lua') diff --git a/lua/lvim/utils/hooks.lua b/lua/lvim/utils/hooks.lua index b40f2c23..8b057884 100644 --- a/lua/lvim/utils/hooks.lua +++ b/lua/lvim/utils/hooks.lua @@ -12,17 +12,25 @@ function M.run_pre_reload() end function M.run_on_packer_complete() - if not in_headless then - -- manually trigger event to fix colors - vim.cmd [[ doautocmd ColorScheme ]] - end - Log:info "Reloaded configuration" + vim.schedule(function() + if not in_headless then + -- colorscheme must get called after plugins are loaded or it will break new installs. + vim.g.colors_name = lvim.colorscheme + vim.cmd("colorscheme " .. lvim.colorscheme) + else + Log:debug "Packer operation complete" + end + end) end function M.run_post_reload() Log:debug "Starting post-reload hook" - require("lvim.plugin-loader").ensure_installed() M.reset_cache() + vim.schedule(function() + if not in_headless then + Log:info "Reloaded configuration" + end + end) end ---Reset any startup cache files used by Packer and Impatient @@ -48,8 +56,8 @@ function M.run_post_update() Log:debug "Starting post-update hook" M.reset_cache() - Log:debug "Updating core plugins" - require("lvim.plugin-loader").ensure_installed() + Log:debug "Syncing core plugins" + require("lvim.plugin-loader").sync_core_plugins() if not in_headless then vim.schedule(function() -- cgit v1.2.3