Skip to content

Highlight config overrides, default flag, blend alpha#94

Merged
barrettruth merged 5 commits intomainfrom
feat/highlight-config-overrides
Feb 7, 2026
Merged

Highlight config overrides, default flag, blend alpha#94
barrettruth merged 5 commits intomainfrom
feat/highlight-config-overrides

Conversation

@barrettruth
Copy link
Owner

Problem

The highlight system computes groups via compute_highlight_groups() but
gives users no config-level way to override them — they must call
nvim_set_hl externally. The DiffsDiff* groups lack default = true,
making them impossible for colorschemes to override (inconsistent with the
fugitive groups). The vimdoc config example has a wrong default for
vim.max_lines.

Solution

  • Fix vim.max_lines default in vimdoc from 500 to 200 to match the actual
    default in init.lua
  • Add default = true to all four DiffsDiff* nvim_set_hl calls so
    colorschemes can override them consistently
  • Add highlights.blend_alpha config option (number, 0-1, default 0.6) to
    control character-level blend intensity, with type validation and range
    check
  • Add highlights.overrides config table that maps group names to highlight
    definitions, applied after computed groups without default so overrides
    always win

Problem: the vimdoc config example showed max_lines = 500 under vim,
but the actual default in init.lua is 200.

Solution: change the example to match the real default.
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.
Problem: the character-level blend intensity was hardcoded to 0.6,
giving users no way to tune how strongly changed characters stand out
from the line-level background.

Solution: add highlights.blend_alpha config option (number, 0-1,
default 0.6) with type validation and range check.
Problem: users had no config-level way to override computed highlight
groups and had to call nvim_set_hl externally.

Solution: add highlights.overrides table that maps group names to
highlight definitions. Overrides are applied after all computed groups
without default = true, so they always win over both computed defaults
and colorscheme definitions.
@barrettruth barrettruth force-pushed the feat/highlight-config-overrides branch from a9eea9c to a0870a7 Compare February 7, 2026 20:50
@barrettruth barrettruth merged commit 52013d0 into main Feb 7, 2026
7 checks passed
@barrettruth barrettruth deleted the feat/highlight-config-overrides branch February 7, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant