mirror of
https://github.com/openai/codex.git
synced 2026-09-15 12:08:01 +00:00
Two fixes from code review:
1. `trim_end_matches('\n')` left a stray `\r` on CRLF inputs, which
propagated into rendered code blocks and diffs. Now strips both
`\r` and `\n`.
2. Unified diff highlighting called `highlight_code_to_styled_spans`
per line, bypassing the global size guardrails (max bytes/lines).
On large patches this triggered thousands of parser initializations.
Added a pre-check on aggregate patch size that skips highlighting
when limits are exceeded.