Selection text extraction guesses soft-wrap spaces #236

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

Location: crates/hx-tui/src/select.rs (selected-text extraction, original line 81)

What is hacky: a wrap at a space leaves no trace in the buffer, so the code assumes a space was there unless the row was full; hard-wrapped text without a space may gain or lose a space.

Proper fix: have the renderer record soft-wrap boundaries and whether a space was consumed.

Original comment: "ponytail: wrap at a space leaves no trace; assume one unless the row was full"

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

Location: crates/hx-tui/src/select.rs (selected-text extraction, original line 81) What is hacky: a wrap at a space leaves no trace in the buffer, so the code assumes a space was there unless the row was full; hard-wrapped text without a space may gain or lose a space. Proper fix: have the renderer record soft-wrap boundaries and whether a space was consumed. Original comment: "ponytail: wrap at a space leaves no trace; assume one unless the row was full" 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#236