mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-30 14:49:43 +02:00
fix(install): avoid data-races for on_packer_complete
(#2157)
This commit is contained in:
parent
66e8facb15
commit
ec1e4140fa
3 changed files with 13 additions and 19 deletions
|
@ -5,33 +5,25 @@ local in_headless = #vim.api.nvim_list_uis() == 0
|
|||
|
||||
function M.run_pre_update()
|
||||
Log:debug "Starting pre-update hook"
|
||||
if package.loaded["lspconfig"] then
|
||||
vim.cmd [[ LspStop ]]
|
||||
end
|
||||
end
|
||||
|
||||
function M.run_pre_reload()
|
||||
Log:debug "Starting pre-reload hook"
|
||||
if package.loaded["lspconfig"] then
|
||||
vim.cmd [[ LspStop ]]
|
||||
end
|
||||
end
|
||||
|
||||
function M.run_on_packer_complete()
|
||||
require("lvim.plugin-loader").recompile()
|
||||
-- forcefully activate nvim-web-devicons
|
||||
require("nvim-web-devicons").set_up_highlights()
|
||||
if package.loaded["lspconfig"] then
|
||||
vim.cmd [[ LspStart ]]
|
||||
end
|
||||
-- manually trigger event to fix colors
|
||||
vim.cmd [[ doautocmd ColorScheme ]]
|
||||
Log:info "Reloaded configuration"
|
||||
end
|
||||
|
||||
function M.run_post_reload()
|
||||
Log:debug "Starting post-reload hook"
|
||||
|
||||
M.reset_cache()
|
||||
require("lvim.plugin-loader").ensure_installed()
|
||||
M.reset_cache()
|
||||
if package.loaded["lspconfig"] then
|
||||
pcall(vim.cmd, "LspRestart")
|
||||
end
|
||||
end
|
||||
|
||||
---Reset any startup cache files used by Packer and Impatient
|
||||
|
@ -67,9 +59,6 @@ function M.run_post_update()
|
|||
end
|
||||
-- TODO: add a changelog
|
||||
vim.notify("Update complete", vim.log.levels.INFO)
|
||||
if package.loaded["lspconfig"] then
|
||||
vim.cmd [[ LspStart ]]
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue