mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 19:34:15 +00:00
feat: when a plugin is disabled conditionally, do not import its additional plugin modules.
This commit is contained in:
parent
6b6f0a4512
commit
beeafc6456
2 changed files with 4 additions and 0 deletions
|
@ -380,6 +380,9 @@ function Spec:import(spec)
|
||||||
if vim.tbl_contains(self.modules, spec.import) then
|
if vim.tbl_contains(self.modules, spec.import) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if spec.cond == false or (type(spec.cond) == "function" and not spec.cond()) then
|
||||||
|
return
|
||||||
|
end
|
||||||
if spec.enabled == false or (type(spec.enabled) == "function" and not spec.enabled()) then
|
if spec.enabled == false or (type(spec.enabled) == "function" and not spec.enabled()) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -75,3 +75,4 @@
|
||||||
---@class LazySpecImport
|
---@class LazySpecImport
|
||||||
---@field import string spec module to import
|
---@field import string spec module to import
|
||||||
---@field enabled? boolean|(fun():boolean)
|
---@field enabled? boolean|(fun():boolean)
|
||||||
|
---@field cond? boolean|(fun():boolean)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue