From 09e5010741e340eb603afbff34453dbee55b7011 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 30 Sep 2023 18:02:07 +0200 Subject: [PATCH] fix(plugin): prevent recursive loop with cond=false. Fixes #1061 --- lua/lazy/core/plugin.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index b418759..d0a2f0b 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -252,10 +252,12 @@ function Spec:fix_cond() local stack = { plugin } while #stack > 0 do local p = table.remove(stack) - for _, dep in ipairs(p.dependencies or {}) do - table.insert(stack, self.plugins[dep]) + if not self.ignore_installed[p.name] then + for _, dep in ipairs(p.dependencies or {}) do + table.insert(stack, self.plugins[dep]) + end + self.ignore_installed[p.name] = true end - self.ignore_installed[p.name] = true end plugin.enabled = false end