From 9177778891ecdf02562eeaa1a26b829e4b62bc16 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 May 2023 14:53:30 +0200 Subject: [PATCH] fix(plugin): rename weak => optional. Makes more sense :) --- lua/lazy/core/plugin.lua | 8 ++++---- lua/lazy/types.lua | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 0f714f8..00e5ecf 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -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 diff --git a/lua/lazy/types.lua b/lua/lazy/types.lua index 5b3821c..df8c19d 100644 --- a/lua/lazy/types.lua +++ b/lua/lazy/types.lua @@ -47,7 +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 optional? 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