From af39d61d3f32683b6e9962d64ab269330b456172 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 May 2023 14:31:23 +0200 Subject: [PATCH] fix: better weak handling --- lua/lazy/core/plugin.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 15d5b2d..0f714f8 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -141,9 +141,14 @@ function Spec:warn(msg) end 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 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 end end