diff --git a/lua/dep/modules/module.lua b/lua/dep/modules/module.lua index 7e6d12e..a16ddf6 100644 --- a/lua/dep/modules/module.lua +++ b/lua/dep/modules/module.lua @@ -5,6 +5,7 @@ local packager = require("dep.package") ---@class module ---@field name string name of the module ---@field desc string description of the module +---@field disable boolean weather to disable all the packages inside the module ---@field path string path to the module ---@field mod table the module ---@field packages package[] all packages registed from the module @@ -18,6 +19,8 @@ local module = {} ---@return module|false module false on failure to load module ---@nodiscard function module:new(modpath, prefix, overrides) + overrides = overrides or {} + local ok, err local o = {} self = {} @@ -45,6 +48,11 @@ function module:new(modpath, prefix, overrides) o.name = o.mod.name or o.name o.desc = o.mod.desc or o.desc + -- ensure the overrides are properly set + overrides = vim.tbl_extend("force", overrides, { + disable = o.mod.disable or overrides.disable + }) + -- allow a module to be a spec if spec_man.check(o.mod, true) ~= false then o.mod = { o.mod }