From 320b232fb458f6c8b2467e3ef9b49034617a2a78 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 5 Apr 2024 15:08:38 +0100 Subject: [PATCH] refactor: remove unused field --- lua/gitsigns/highlight.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lua/gitsigns/highlight.lua b/lua/gitsigns/highlight.lua index 374a45df8..e4bf8cd1a 100644 --- a/lua/gitsigns/highlight.lua +++ b/lua/gitsigns/highlight.lua @@ -5,7 +5,6 @@ local api = vim.api --- @field desc string --- @field hidden boolean --- @field fg_factor number ---- @field bg_factor number local nvim10 = vim.fn.has('nvim-0.10') > 0 @@ -293,14 +292,13 @@ local function derive(hl, hldef) for _, d in ipairs(hldef) do if is_hl_set(d) then dprintf('Deriving %s from %s', hl, d) - if hldef.fg_factor or hldef.bg_factor then + if hldef.fg_factor then hldef.fg_factor = hldef.fg_factor or 1 - hldef.bg_factor = hldef.bg_factor or 1 local dh = get_hl(d) api.nvim_set_hl(0, hl, { default = true, fg = cmul(dh.foreground, hldef.fg_factor), - bg = cmul(dh.background, hldef.bg_factor), + bg = dh.background, }) else api.nvim_set_hl(0, hl, { default = true, link = d }) @@ -308,7 +306,7 @@ local function derive(hl, hldef) return end end - if hldef[1] and not hldef.bg_factor and not hldef.fg_factor then + if hldef[1] and not hldef.fg_factor then -- No fallback found which is set. Just link to the first fallback -- if there are no modifiers dprintf('Deriving %s from %s', hl, hldef[1])