Skip to content

Commit

Permalink
fix: dont autoload cached modules when module=false
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 20, 2022
1 parent 992c679 commit 316503f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/lazy/core/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ function M.check_path(modname, modpath)
local plugin = require("lazy.core.plugin").find(modpath)
if plugin and modpath:find(plugin.dir, 1, true) == 1 then
if not plugin._.loaded then
if plugin.module == false then
error("Plugin " .. plugin.name .. " is not loaded and is configured with module=false")
end
require("lazy.core.loader").load(plugin, { require = modname })
end
return true
Expand Down

0 comments on commit 316503f

Please sign in to comment.