Editor wraps by char count, not display width #235

Open
opened 2026-11-21 12:37:06 +00:00 by johannes · 0 comments
Owner

Location: crates/hx-tui/src/editor.rs (row-wrapping fn, wrap/rows computation near original line 160)

What is hacky: wrapping and cursor placement count chars, not terminal cell width, so CJK and emoji can overflow a row by a cell.

Proper fix: use unicode-width for row breaks and cursor column.

Original comment: "ponytail: counts chars, not cell width; CJK/emoji can overflow a row by a cell. Use unicode-width if it matters."

Found by the comment audit: the comment excusing this was deleted (see scripts/lint-comments.sh).

Location: crates/hx-tui/src/editor.rs (row-wrapping fn, `wrap`/rows computation near original line 160) What is hacky: wrapping and cursor placement count chars, not terminal cell width, so CJK and emoji can overflow a row by a cell. Proper fix: use unicode-width for row breaks and cursor column. Original comment: "ponytail: counts chars, not cell width; CJK/emoji can overflow a row by a cell. Use unicode-width if it matters." Found by the comment audit: the comment excusing this was deleted (see scripts/lint-comments.sh).
johannes added the tui label 2026-11-21 12:37:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#235