fix(highlight): omit DiffsClear bg on transparent themes (#179)
Some checks are pending
luarocks / quality (push) Waiting to run
luarocks / publish (push) Blocked by required conditions

This commit is contained in:
Barrett Ruth 2026-03-08 16:08:36 -04:00 committed by GitHub
parent 59714381f1
commit c7cd8fc24c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 3 deletions

View file

@ -554,7 +554,7 @@ describe('diffs', function()
diffs._test.set_hl_retry_pending(false)
end)
it('uses dark fallback bg for DiffsClear when Normal.bg is nil (transparent)', function()
it('omits DiffsClear.bg when Normal.bg is nil (transparent)', function()
vim.api.nvim_get_hl = function(ns, opts)
if opts.name == 'Normal' then
return { fg = 0xc0c0c0 }
@ -562,11 +562,22 @@ describe('diffs', function()
return saved_get_hl(ns, opts)
end
diffs._test.compute_highlight_groups()
assert.are.equal(0x1a1a1a, set_calls.DiffsClear.bg)
assert.is_nil(set_calls.DiffsClear.bg)
assert.is_table(set_calls.DiffsAdd)
assert.is_table(set_calls.DiffsDelete)
end)
it('sets DiffsClear.bg to Normal.bg on opaque themes', function()
vim.api.nvim_get_hl = function(ns, opts)
if opts.name == 'Normal' then
return { fg = 0xebdbb2, bg = 0x282828 }
end
return saved_get_hl(ns, opts)
end
diffs._test.compute_highlight_groups()
assert.are.equal(0x282828, set_calls.DiffsClear.bg)
end)
it('blend_alpha controls DiffsAdd.bg intensity', function()
local saved_config_alpha = diffs._test.get_config().highlights.blend_alpha
diffs._test.get_config().highlights.blend_alpha = 0.3