Skip to content

feat: add syntax highlighting for diff code using emphasize#79

Open
watany-dev wants to merge 2 commits intomainfrom
claude/evaluate-code-highlighting-e5cAh
Open

feat: add syntax highlighting for diff code using emphasize#79
watany-dev wants to merge 2 commits intomainfrom
claude/evaluate-code-highlighting-e5cAh

Conversation

@watany-dev
Copy link
Copy Markdown
Owner

Implement language-aware syntax highlighting for diff lines in the TUI.
The prefix (+/-/space) retains its diff color while code content gets
token-level coloring via the emphasize library (highlight.js wrapper).

  • Add highlightCode utility: language detection from file extension,
    ANSI-to-segment parser, and highlightLine function
  • Modify DiffLine to render highlighted segments for add/delete/context
  • Support 37 common languages (TypeScript, Python, Go, Rust, etc.)
  • Pure JS, no native dependencies (CloudShell compatible)
  • 26 unit tests for highlighting, 14 for DiffLine rendering

https://claude.ai/code/session_014NYVEWAyfKd44Ah4QroxBs

Implement language-aware syntax highlighting for diff lines in the TUI.
The prefix (+/-/space) retains its diff color while code content gets
token-level coloring via the emphasize library (highlight.js wrapper).

- Add highlightCode utility: language detection from file extension,
  ANSI-to-segment parser, and highlightLine function
- Modify DiffLine to render highlighted segments for add/delete/context
- Support 37 common languages (TypeScript, Python, Go, Rust, etc.)
- Pure JS, no native dependencies (CloudShell compatible)
- 26 unit tests for highlighting, 14 for DiffLine rendering

https://claude.ai/code/session_014NYVEWAyfKd44Ah4QroxBs
@watany-dev watany-dev force-pushed the claude/evaluate-code-highlighting-e5cAh branch from b5ef91d to 54d8c1b Compare February 21, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants