mirror of https://github.com/folke/lazy.nvim.git
refactor: Plugin.requires => Plugin.dependencies
This commit is contained in:
parent
0f5ceb9012
commit
7328e290ba
|
@ -61,8 +61,8 @@ function M.load(plugins, reason, opts)
|
||||||
Util.track({ plugin = plugin.name, start = reason.start })
|
Util.track({ plugin = plugin.name, start = reason.start })
|
||||||
M.packadd(plugin, opts and opts.load_start)
|
M.packadd(plugin, opts and opts.load_start)
|
||||||
|
|
||||||
if plugin.requires then
|
if plugin.dependencies then
|
||||||
M.load(plugin.requires, {})
|
M.load(plugin.dependencies, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
if plugin.config then
|
if plugin.config then
|
||||||
|
|
|
@ -40,10 +40,10 @@ M.dirty = false
|
||||||
---@field dir string
|
---@field dir string
|
||||||
---@field enabled? boolean|(fun():boolean)
|
---@field enabled? boolean|(fun():boolean)
|
||||||
---@field opt? boolean
|
---@field opt? boolean
|
||||||
---@field requires? string[]
|
---@field dependencies? string[]
|
||||||
---@field _ LazyPluginState
|
---@field _ LazyPluginState
|
||||||
|
|
||||||
---@alias LazySpec string|LazyPlugin|LazySpec[]|{requires:LazySpec}
|
---@alias LazySpec string|LazyPlugin|LazySpec[]|{dependencies:LazySpec}
|
||||||
|
|
||||||
---@class LazySpecLoader
|
---@class LazySpecLoader
|
||||||
---@field modname string
|
---@field modname string
|
||||||
|
@ -103,7 +103,7 @@ function Spec:normalize(spec, results)
|
||||||
elseif spec.enabled == nil or spec.enabled == true or (type(spec.enabled) == "function" and spec.enabled()) then
|
elseif spec.enabled == nil or spec.enabled == true or (type(spec.enabled) == "function" and spec.enabled()) then
|
||||||
---@cast spec LazyPlugin
|
---@cast spec LazyPlugin
|
||||||
local plugin = self:add(spec)
|
local plugin = self:add(spec)
|
||||||
plugin.requires = plugin.requires and self:normalize(plugin.requires, {}) or nil
|
plugin.dependencies = plugin.dependencies and self:normalize(plugin.dependencies, {}) or nil
|
||||||
table.insert(results, plugin.name)
|
table.insert(results, plugin.name)
|
||||||
end
|
end
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in New Issue