Skip to content

Commit b052d3c

Browse files
stevenpollackclaude
andcommitted
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. Squash of feat/diff-highlight (baa41a2 + e136a64). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BMQxBdr5f3B3jmDtdvGtTu
1 parent 685cca9 commit b052d3c

9 files changed

Lines changed: 662 additions & 42 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111
* support x509 commit signing [[@kaden-l-nelson](https://github.com/kaden-l-nelson)] ([#2514](https://github.com/gitui-org/gitui/issues/2514))
12+
* syntax highlighting in the diff view ([Shift+X] cycles style: off / gutter / +- sign / tint) [[@stevenpollack](https://github.com/stevenpollack)]
1213

1314
### Changed
1415
* use [tombi](https://github.com/tombi-toml/tombi) for all toml file formatting

0 commit comments

Comments
 (0)