mirror of https://github.com/folke/lazy.nvim.git
fix(loader): never load lua files from a plugin where cond=false. Show error instead
This commit is contained in:
parent
623e00cabb
commit
10f5844abf
|
@ -460,6 +460,9 @@ function M.auto_load(modname, modpath)
|
||||||
error("Plugin " .. plugin.name .. " is not loaded and is configured with module=false")
|
error("Plugin " .. plugin.name .. " is not loaded and is configured with module=false")
|
||||||
end
|
end
|
||||||
M.load(plugin, { require = modname })
|
M.load(plugin, { require = modname })
|
||||||
|
if plugin._.cond == false then
|
||||||
|
error("You're trying to load `" .. plugin.name .. "` for which `cond==false`")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -470,7 +473,6 @@ end
|
||||||
function M.loader(modname)
|
function M.loader(modname)
|
||||||
local paths = Util.get_unloaded_rtp(modname)
|
local paths = Util.get_unloaded_rtp(modname)
|
||||||
local modpath, hash = Cache._Cache.find(modname, { rtp = false, paths = paths })
|
local modpath, hash = Cache._Cache.find(modname, { rtp = false, paths = paths })
|
||||||
-- print(modname .. " " .. paths[1])
|
|
||||||
if modpath then
|
if modpath then
|
||||||
M.auto_load(modname, modpath)
|
M.auto_load(modname, modpath)
|
||||||
local mod = package.loaded[modname]
|
local mod = package.loaded[modname]
|
||||||
|
|
Loading…
Reference in New Issue