Skip to content

Commit 10f5844

Browse files
committed
fix(loader): never load lua files from a plugin where cond=false. Show error instead
1 parent 623e00c commit 10f5844

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/lazy/core/loader.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ function M.auto_load(modname, modpath)
460460
error("Plugin " .. plugin.name .. " is not loaded and is configured with module=false")
461461
end
462462
M.load(plugin, { require = modname })
463+
if plugin._.cond == false then
464+
error("You're trying to load `" .. plugin.name .. "` for which `cond==false`")
465+
end
463466
end
464467
return true
465468
end
@@ -470,7 +473,6 @@ end
470473
function M.loader(modname)
471474
local paths = Util.get_unloaded_rtp(modname)
472475
local modpath, hash = Cache._Cache.find(modname, { rtp = false, paths = paths })
473-
-- print(modname .. " " .. paths[1])
474476
if modpath then
475477
M.auto_load(modname, modpath)
476478
local mod = package.loaded[modname]

0 commit comments

Comments
 (0)