mirror of https://github.com/folke/lazy.nvim.git
fix: better weak handling
This commit is contained in:
parent
cd3802a54b
commit
af39d61d3f
|
@ -141,9 +141,14 @@ function Spec:warn(msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Spec:fix_disabled()
|
function Spec:fix_disabled()
|
||||||
|
---@param plugin LazyPlugin
|
||||||
|
local function all_weak(plugin)
|
||||||
|
return (not plugin) or (rawget(plugin, "weak") and all_weak(plugin._.super))
|
||||||
|
end
|
||||||
|
|
||||||
-- handle weak plugins
|
-- handle weak plugins
|
||||||
for _, plugin in pairs(self.plugins) do
|
for _, plugin in pairs(self.plugins) do
|
||||||
if plugin.weak and not plugin._.super then
|
if plugin.weak and all_weak(plugin) then
|
||||||
self.plugins[plugin.name] = nil
|
self.plugins[plugin.name] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue