Skip to content

Commit

Permalink
feat(plugin): added support for weak specs. They will not be includ…
Browse files Browse the repository at this point in the history
…ed in the final spec if not specified somwhere else
  • Loading branch information
folke committed May 22, 2023
1 parent b382495 commit 8564f6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/lazy/core/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ function Spec:warn(msg)
end

function Spec:fix_disabled()
-- handle weak plugins
for _, plugin in pairs(self.plugins) do
if plugin.weak and not plugin._.super then
self.plugins[plugin.name] = nil
end
end

---@type table<string,string[]> plugin to parent plugin
local dep_of = {}

Expand Down
1 change: 1 addition & 0 deletions lua/lazy/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
---@field dir string
---@field enabled? boolean|(fun():boolean)
---@field cond? boolean|(fun():boolean)
---@field weak? boolean If set, then this plugin will not be added unless it is added somewhere else
---@field lazy? boolean
---@field priority? number Only useful for lazy=false plugins to force loading certain plugins first. Default priority is 50
---@field dev? boolean If set, then link to the respective folder under your ~/projects
Expand Down

0 comments on commit 8564f6d

Please sign in to comment.