Skip to content

fix: use display-width-aware truncation for Copied message#41

Merged
eitsupi merged 2 commits intomainfrom
fix/cjk-truncate-meta-command
Feb 3, 2026
Merged

fix: use display-width-aware truncation for Copied message#41
eitsupi merged 2 commits intomainfrom
fix/cjk-truncate-meta-command

Conversation

@eitsupi
Copy link
Copy Markdown
Owner

@eitsupi eitsupi commented Feb 3, 2026

Summary

  • Replace chars().count() / chars().take() with text_utils::truncate_to_width() in the history browser "Copied" message, so CJK and other full-width characters are correctly measured by display columns
  • Add tests for the truncation behavior with CJK input

eitsupi and others added 2 commits February 3, 2026 14:50
Replace chars().count()/chars().take() with text_utils::truncate_to_width()
so that CJK and other full-width characters are correctly measured by
display columns instead of Unicode scalar count.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Verify that truncate_to_width behaves correctly for the meta_command
"Copied" display: CJK-heavy strings are truncated within 60 columns
with an ellipsis, and short strings pass through unchanged.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@eitsupi eitsupi merged commit 1239a63 into main Feb 3, 2026
10 checks passed
@eitsupi eitsupi deleted the fix/cjk-truncate-meta-command branch February 3, 2026 14:58
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.

1 participant