fix(highlight): add default flag to DiffsDiff* groups
Problem: DiffsDiff* highlight groups lacked default = true, making them impossible for colorschemes to override, inconsistent with the fugitive unified diff groups which already had it. Solution: add default = true to all four DiffsDiffAdd, DiffsDiffDelete, DiffsDiffChange, and DiffsDiffText nvim_set_hl calls.
This commit is contained in:
parent
bcc70280fb
commit
8e0c41bf6b
2 changed files with 11 additions and 7 deletions
|
|
@ -398,9 +398,9 @@ diff-related features.
|
|||
==============================================================================
|
||||
HIGHLIGHT GROUPS *diffs-highlights*
|
||||
|
||||
diffs.nvim defines custom highlight groups. Fugitive unified diff groups use
|
||||
`default = true`, so colorschemes can override them. Diff mode groups are
|
||||
always derived from the corresponding `Diff*` groups.
|
||||
diffs.nvim defines custom highlight groups. All groups use `default = true`,
|
||||
so colorschemes can override them by defining the group before the plugin
|
||||
loads.
|
||||
|
||||
All derived groups are computed by alpha-blending a source color into the
|
||||
`Normal` background. Line-level groups blend at 40% alpha for a subtle tint;
|
||||
|
|
|
|||
|
|
@ -219,10 +219,14 @@ local function compute_highlight_groups()
|
|||
local diff_change = resolve_hl('DiffChange')
|
||||
local diff_text = resolve_hl('DiffText')
|
||||
|
||||
vim.api.nvim_set_hl(0, 'DiffsDiffAdd', { bg = diff_add.bg })
|
||||
vim.api.nvim_set_hl(0, 'DiffsDiffDelete', { fg = diff_delete.fg, bg = diff_delete.bg })
|
||||
vim.api.nvim_set_hl(0, 'DiffsDiffChange', { bg = diff_change.bg })
|
||||
vim.api.nvim_set_hl(0, 'DiffsDiffText', { bg = diff_text.bg })
|
||||
vim.api.nvim_set_hl(0, 'DiffsDiffAdd', { default = true, bg = diff_add.bg })
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'DiffsDiffDelete',
|
||||
{ default = true, fg = diff_delete.fg, bg = diff_delete.bg }
|
||||
)
|
||||
vim.api.nvim_set_hl(0, 'DiffsDiffChange', { default = true, bg = diff_change.bg })
|
||||
vim.api.nvim_set_hl(0, 'DiffsDiffText', { default = true, bg = diff_text.bg })
|
||||
end
|
||||
|
||||
local function init()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue