fix(plugin): rename weak => optional. Makes more sense :)

This commit is contained in:
Folke Lemaitre 2023-05-22 14:53:30 +02:00
parent 8cd4a59674
commit 9177778891
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 5 additions and 5 deletions

View file

@ -142,13 +142,13 @@ end
function Spec:fix_disabled()
---@param plugin LazyPlugin
local function all_weak(plugin)
return (not plugin) or (rawget(plugin, "weak") and all_weak(plugin._.super))
local function all_optional(plugin)
return (not plugin) or (rawget(plugin, "optional") and all_optional(plugin._.super))
end
-- handle weak plugins
-- handle optional plugins
for _, plugin in pairs(self.plugins) do
if plugin.weak and all_weak(plugin) then
if plugin.optional and all_optional(plugin) then
self.plugins[plugin.name] = nil
end
end