feat(spec): added support for importing multiple spec modules with import = "foobar"

This commit is contained in:
Folke Lemaitre 2023-01-01 21:07:05 +01:00
parent 3974a6cbe3
commit 39b66027a5
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
4 changed files with 57 additions and 40 deletions

View file

@ -144,9 +144,12 @@ M.defaults = {
M.ns = vim.api.nvim_create_namespace("lazy")
---@type string|LazySpec Should be either a string pointing to a module, or a spec
---@type LazySpec
M.spec = nil
---@type LazySpecLoader
M.parsed = nil
---@type table<string, LazyPlugin>
M.plugins = {}
@ -167,7 +170,7 @@ M.headless = #vim.api.nvim_list_uis() == 0
---@param spec LazySpec
---@param opts? LazyConfig
function M.setup(spec, opts)
M.spec = spec
M.spec = type(spec) == "string" and { import = spec } or spec
M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
M.options.performance.cache = require("lazy.core.cache")
table.insert(M.options.install.colorscheme, "habamax")