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
|
end
|
||||||
for _, plugin in pairs(Config.plugins) do
|
for _, plugin in pairs(Config.plugins) do
|
||||||
Util.try(function()
|
Util.try(function()
|
||||||
M.enable(plugin)
|
M.enable(plugin, true)
|
||||||
end, "Failed to setup handlers for " .. plugin.name)
|
end, "Failed to setup handlers for " .. plugin.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -40,8 +40,9 @@ function M.disable(plugin)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param plugin LazyPlugin
|
---@param plugin LazyPlugin
|
||||||
function M.enable(plugin)
|
---@param force? boolean
|
||||||
if not plugin._.loaded then
|
function M.enable(plugin, force)
|
||||||
|
if force or not plugin._.loaded then
|
||||||
for type, handler in pairs(M.handlers) do
|
for type, handler in pairs(M.handlers) do
|
||||||
if plugin[type] then
|
if plugin[type] then
|
||||||
handler:add(plugin)
|
handler:add(plugin)
|
||||||
|
|
|
@ -70,7 +70,7 @@ function M.install_missing()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
require("lazy.manage").install({ wait = true, lockfile = true })
|
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
|
for _, p in pairs(Config.plugins) do
|
||||||
if p._.installed then
|
if p._.installed then
|
||||||
Cache.reset(p.dir)
|
Cache.reset(p.dir)
|
||||||
|
|
Loading…
Reference in New Issue