Skip to content

Commit

Permalink
refactor: remove unused field
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Apr 5, 2024
1 parent ade22fc commit 320b232
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lua/gitsigns/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -293,22 +292,21 @@ 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 })
end
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])
Expand Down

0 comments on commit 320b232

Please sign in to comment.