Severity: Low
Location: src/lib/syntax/highlightEngine.ts:234
Area: lib-ui-utils
Summary
Inside a hunk, any line whose first char isn't '+', '-', or ' ' sets inHunk = false. The unified-diff metadata line \ No newline at end of file starts with '' and legitimately appears mid-hunk (after the '-' side when the old file lacked a trailing newline, with '+' lines following). Hitting it flips inHunk off, so every subsequent code line of that hunk is excluded from highlighting until the next '@@'. The sibling parser (src/workstation/chrome/splitDiff.ts:127) correctly passes this marker through, and its test suite explicitly covers it; highlightEngine's tests don't.
Failure scenario
Diff view (worktree/stash/commit) of a .ts file whose last line previously had no trailing newline -> hunk contains -oldline, \ No newline at end of file, +oldline, +newline -> the added lines after the marker render completely unhighlighted (plain color) while the rest of the file is highlighted.
Suggested fix
Treat lines starting with '' as pass-through metadata (continue without clearing inHunk), matching splitDiff.ts.
Found via a full-codebase audit (10 scoped bug finders + adversarial verification) after the 0.82.0 release.
Severity: Low
Location:
src/lib/syntax/highlightEngine.ts:234Area: lib-ui-utils
Summary
Inside a hunk, any line whose first char isn't '+', '-', or ' ' sets inHunk = false. The unified-diff metadata line
\ No newline at end of filestarts with '' and legitimately appears mid-hunk (after the '-' side when the old file lacked a trailing newline, with '+' lines following). Hitting it flips inHunk off, so every subsequent code line of that hunk is excluded from highlighting until the next '@@'. The sibling parser (src/workstation/chrome/splitDiff.ts:127) correctly passes this marker through, and its test suite explicitly covers it; highlightEngine's tests don't.Failure scenario
Diff view (worktree/stash/commit) of a .ts file whose last line previously had no trailing newline -> hunk contains
-oldline,\ No newline at end of file,+oldline,+newline-> the added lines after the marker render completely unhighlighted (plain color) while the rest of the file is highlighted.Suggested fix
Treat lines starting with '' as pass-through metadata (continue without clearing inHunk), matching splitDiff.ts.
Found via a full-codebase audit (10 scoped bug finders + adversarial verification) after the 0.82.0 release.