From 805b85c2ea3bd6f9506ef22cbd6e3a39172b5b08 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 13 Dec 2024 19:56:52 +0100 Subject: [PATCH] fix(meta): when a plugin is both optional and disabled, then just delete it from the list --- lua/lazy/core/meta.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/meta.lua b/lua/lazy/core/meta.lua index abb2508..88263a2 100644 --- a/lua/lazy/core/meta.lua +++ b/lua/lazy/core/meta.lua @@ -305,7 +305,11 @@ function M:fix_disabled() for _, plugin in pairs(self.plugins) do if plugin.enabled == false or (type(plugin.enabled) == "function" and not plugin.enabled()) then changes = changes + 1 - self:disable(plugin) + if plugin.optional then + self:del(plugin.name) + else + self:disable(plugin) + end end end self:rebuild()