From 1fd80159d074e5c22b946d9b87f274a243ecf213 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 3 Jan 2023 22:49:04 +0100 Subject: [PATCH] fix(spec): show error when users load a plugins module called `lazy` --- lua/lazy/core/plugin.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index dd4ebfd..2b3fbf2 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -158,6 +158,9 @@ end ---@param spec LazySpecImport function Spec:import(spec) + if spec.import == "lazy" then + return self:error("You can't name your plugins module `lazy`.") + end if spec.enabled == false or (type(spec.enabled) == "function" and not spec.enabled()) then return end