From 316503f124eb4caf5b3bac0da16ee6ac10322424 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 20 Dec 2022 16:02:22 +0100 Subject: [PATCH] fix: dont autoload cached modules when module=false --- lua/lazy/core/cache.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazy/core/cache.lua b/lua/lazy/core/cache.lua index 7038171..b408a33 100644 --- a/lua/lazy/core/cache.lua +++ b/lua/lazy/core/cache.lua @@ -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