mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-27 19:24:13 +00:00
feat(spec): added import
to import other plugin modules
This commit is contained in:
parent
313015fdb4
commit
919b7f5de3
7 changed files with 74 additions and 46 deletions
|
@ -2,9 +2,17 @@
|
|||
local M = {}
|
||||
M._start = 0
|
||||
|
||||
---@param spec LazySpec Should be a module name to load, or a plugin spec
|
||||
---@param opts? LazyConfig
|
||||
---@overload fun(opts: LazyConfig)
|
||||
---@overload fun(spec:LazySpec, opts: LazyConfig)
|
||||
function M.setup(spec, opts)
|
||||
if type(spec) == "table" and spec.spec then
|
||||
---@cast spec LazyConfig
|
||||
opts = spec
|
||||
else
|
||||
opts = opts or {}
|
||||
opts.spec = spec
|
||||
end
|
||||
|
||||
M._start = M._start == 0 and vim.loop.hrtime() or M._start
|
||||
if vim.g.lazy_did_setup then
|
||||
return vim.notify(
|
||||
|
@ -38,7 +46,7 @@ function M.setup(spec, opts)
|
|||
|
||||
-- load config
|
||||
Util.track("config")
|
||||
Config.setup(spec, opts)
|
||||
Config.setup(opts)
|
||||
Util.track()
|
||||
|
||||
-- load the plugins
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue