Repository navigation
feat: add diff syntax highlighting to code blocks - #59
Merged
Merged
Conversation
Bundle the tree-sitter-diff v0.2.0 grammar with `patch` as an alias and style added/removed/changed lines green/red/yellow. The vendored highlights.scm drops the line markers (+ - < > !) from the punctuation.special capture: OpenTUI ignores `priority`, so that capture overrode the line color on the marker. parsers-config.json points at the local query so update-parsers keeps the edit.
Startup benchmark (
|
| build | mean | ratio | verdict |
|---|---|---|---|
| baseline (main@3350e91) | 371.7ms ± 9.1ms | — | |
| PR | 371.4ms ± 4.1ms | 1.00× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
First-frame (large.md, runs=10)
| metric | baseline (main@3350e91) | PR | ratio | verdict |
|---|---|---|---|---|
| first-frame | 284.8ms | 283.4ms | 1.00× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
Scroll (large.md)
| metric | baseline (main@3350e91) | PR | ratio | verdict |
|---|---|---|---|---|
| full_mount | 11958.0ms | 11920.0ms | 1.00× | ✅ ok |
| step_p50 | 27.5ms | 27.5ms | 1.00× | ✅ ok |
| step_search_p50 | 28.2ms | 28.5ms | 1.01× | ✅ ok |
| stepMatch_p50 | 19.5ms | 19.3ms | 0.99× | ✅ ok |
| commit | 159.1ms | 143.5ms | 0.90× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
denolfe
added a commit
that referenced
this pull request
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code blocks fenced as
difforpatchnow render with syntax highlighting. Added lines are green, removed lines are red, and changed lines (context-diff!lines) are yellow.Key Changes
tree-sitter-diffv0.2.0 wasm and its highlight query underassets/parsers/diff.diff, withpatchas an alias.diff.plus,diff.minus, anddiff.deltastyles use the theme's green, red, and yellow.+ - < > !line markers from itspunctuation.specialcapture. The markers then take the color of their line.prioritysetting. With the upstream query, the marker renders grey on a green or red line.parsers-config.jsonpoints at the local query.update-parserskeeps the edit when it regenerates assets.References / Links