diff --git a/doc/diffs.nvim.txt b/doc/diffs.nvim.txt index 3db6db6..7704b5b 100644 --- a/doc/diffs.nvim.txt +++ b/doc/diffs.nvim.txt @@ -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; diff --git a/lua/diffs/init.lua b/lua/diffs/init.lua index cfdfb4b..14a4c13 100644 --- a/lua/diffs/init.lua +++ b/lua/diffs/init.lua @@ -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()