Skip to content

Commit

Permalink
fix(build): make sure to properly load handlers for plugins that were…
Browse files Browse the repository at this point in the history
… built during startup. Fixes #744
  • Loading branch information
folke committed Apr 24, 2023
1 parent a55ab60 commit a758588
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lua/lazy/core/handler/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a758588

Please sign in to comment.