From 638c8e6382f121aef983c78d865f6dbbc72d68c3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 4 Oct 2023 11:48:14 +0200 Subject: [PATCH] fix(plugin): rebuild plugins after fixing optional and cond to ensure enabled will work correctly --- lua/lazy/core/plugin.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 4255366..0517aa3 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -292,7 +292,12 @@ function Spec:fix_disabled() end self:fix_optional() + -- rebuild any plugin specs that were modified + for name, _ in pairs(self.dirty) do + self:rebuild(name) + end self:fix_cond() + self.dirty = {} for _, plugin in pairs(self.plugins) do local disabled = plugin.enabled == false or (type(plugin.enabled) == "function" and not plugin.enabled())