mirror of https://github.com/folke/lazy.nvim.git
fix(build): make sure to properly load handlers for plugins that were built during startup. Fixes #744
This commit is contained in:
parent
a55ab60625
commit
a758588008
|
@ -25,7 +25,7 @@ function M.setup()
|
|||
end
|
||||
for _, plugin in pairs(Config.plugins) do
|
||||
Util.try(function()
|
||||
M.enable(plugin)
|
||||
M.enable(plugin, true)
|
||||
end, "Failed to setup handlers for " .. plugin.name)
|
||||
end
|
||||
end
|
||||
|
@ -40,8 +40,9 @@ function M.disable(plugin)
|
|||
end
|
||||
|
||||
---@param plugin LazyPlugin
|
||||
function M.enable(plugin)
|
||||
if not plugin._.loaded then
|
||||
---@param force? boolean
|
||||
function M.enable(plugin, force)
|
||||
if force or not plugin._.loaded then
|
||||
for type, handler in pairs(M.handlers) do
|
||||
if plugin[type] then
|
||||
handler:add(plugin)
|
||||
|
|
|
@ -70,7 +70,7 @@ function M.install_missing()
|
|||
end
|
||||
end
|
||||
require("lazy.manage").install({ wait = true, lockfile = true })
|
||||
-- remove and installed plugins from indexed, so cache will index again
|
||||
-- remove any installed plugins from indexed, so cache will index again
|
||||
for _, p in pairs(Config.plugins) do
|
||||
if p._.installed then
|
||||
Cache.reset(p.dir)
|
||||
|
|
Loading…
Reference in New Issue