Skip to content

Commit

Permalink
fix(install): make sure to setup loaders before attempting install so…
Browse files Browse the repository at this point in the history
… colorscheme can load. Fixes #122
  • Loading branch information
folke committed Dec 23, 2022
1 parent e5dcc87 commit 7b9b476
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 7b9b476

Please sign in to comment.