mirror of
https://github.com/openai/codex.git
synced 2026-09-17 12:23:33 +00:00
Two fixes:
1. highlight.rs: The fallback path used split('\n') which produces a
phantom empty trailing element for inputs ending in '\n' (as
pulldown-cmark emits for code blocks). Switch to lines() which
handles trailing newlines correctly.
2. diff_render.rs: wrap_styled_spans only flushed the current line
when col >= max_cols AND the current span had remaining content.
This missed the case where one span ends exactly at max_cols and
the next span has content — the next span's first character was
appended to the already-full line. Remove the !remaining.is_empty()
guard so the line flushes at span boundaries too.