Commit a04e8b8
feat(diff): syntax-highlight the unified diff view (async, cycling styles)
Each diff line's foreground is now syntect-highlighted (reusing the
in-tree two-face syntax set that already powers the file/blame viewer
— no new deps, no external bat), keeping both added and removed sides.
Change status is shown by a selectable indicator; [Shift+X] cycles
off / gutter (colored bar) / sign (green + / red -) / tint (faint row
background). Default tint. Persisted per-repo.
Highlighting runs off the UI thread on the shared rayon threadpool
(AsyncDiffHighlightJob, modeled on the blame view's AsyncSyntaxJob):
the diff renders plain instantly and colors swap in when ready, so
file navigation never blocks regardless of diff size. The result is
self-polled in draw() and applied only if its diff hash still matches
(stale results discarded). Capped at 10k lines; horizontal scroll
preserved via byte-window clipping; falls back to the previous
red/green rendering when off, over cap, binary, or highlight fails.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMQxBdr5f3B3jmDtdvGtTu1 parent 685cca9 commit a04e8b8
9 files changed
Lines changed: 662 additions & 42 deletions
File tree
- src
- components
- keys
- ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments