Skip to content

Commit af39d61

Browse files
committed
fix: better weak handling
1 parent cd3802a commit af39d61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/lazy/core/plugin.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,14 @@ function Spec:warn(msg)
141141
end
142142

143143
function Spec:fix_disabled()
144+
---@param plugin LazyPlugin
145+
local function all_weak(plugin)
146+
return (not plugin) or (rawget(plugin, "weak") and all_weak(plugin._.super))
147+
end
148+
144149
-- handle weak plugins
145150
for _, plugin in pairs(self.plugins) do
146-
if plugin.weak and not plugin._.super then
151+
if plugin.weak and all_weak(plugin) then
147152
self.plugins[plugin.name] = nil
148153
end
149154
end

0 commit comments

Comments
 (0)