fix(highlight): use theme-agnostic fallbacks and retry when Normal has no background (#153)
## Problem Highlight group fallbacks in `compute_highlight_groups` were hardcoded to catppuccin mocha colors, producing wrong results for any other colorscheme when `Normal.bg` is nil. This happens on transparent terminals or when the colorscheme loads after the first diff buffer opens. ## Solution Replace hardcoded fallbacks with `vim.o.background`-aware neutral values. When `Normal.bg` is still absent after initial computation, schedule a single deferred retry via `vim.schedule` that recomputes and invalidates all attached buffer caches. Document the load-order requirement in the setup section.
This commit is contained in:
parent
e7d56e3bbe
commit
58589947e8
2 changed files with 27 additions and 6 deletions
|
|
@ -65,6 +65,9 @@ Install with lazy.nvim: >lua
|
|||
The plugin works automatically with no configuration required. For
|
||||
customization, see |diffs-config|.
|
||||
|
||||
NOTE: Load your colorscheme before `diffs.nvim`. For example, with lazy.nvim,
|
||||
set `priority = 1000` and `lazy = false` on your colorscheme plugin.
|
||||
|
||||
==============================================================================
|
||||
CONFIGURATION *diffs-config*
|
||||
|
||||
|
|
@ -758,6 +761,7 @@ character-level groups blend at 60% for more contrast. Line-number groups
|
|||
combine both: background from the line-level blend, foreground from the
|
||||
character-level blend.
|
||||
|
||||
|
||||
Fugitive unified diff highlights: ~
|
||||
*DiffsAdd*
|
||||
DiffsAdd Background for `+` lines. Derived by blending
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue