fix(install): make sure to setup loaders before attempting install so colorscheme can load. Fixes #122

This commit is contained in:
Folke Lemaitre 2022-12-23 07:35:44 +01:00
parent e5dcc87149
commit 7b9b476a62
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 17 additions and 17 deletions

View File

@ -11,23 +11,6 @@ M.init_done = false
M.disabled_rtp_plugins = { packer_compiled = true }
function M.setup()
-- install missing plugins
if Config.options.install.missing then
Util.track("install")
for _, plugin in pairs(Config.plugins) do
if not plugin._.installed then
for _, colorscheme in ipairs(Config.options.install.colorscheme) do
if pcall(vim.cmd.colorscheme, colorscheme) then
break
end
end
require("lazy.manage").install({ wait = true })
break
end
end
Util.track()
end
-- setup handlers
Util.track("handlers")
Handler.setup()
@ -45,6 +28,23 @@ function M.setup()
-- autoload opt plugins
table.insert(package.loaders, M.autoload)
-- install missing plugins
if Config.options.install.missing then
Util.track("install")
for _, plugin in pairs(Config.plugins) do
if not plugin._.installed then
for _, colorscheme in ipairs(Config.options.install.colorscheme) do
if pcall(vim.cmd.colorscheme, colorscheme) then
break
end
end
require("lazy.manage").install({ wait = true })
break
end
end
Util.track()
end
end
-- Startup sequence