Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
=======================================
Coverage 92.64% 92.64%
=======================================
Files 100 100
Lines 9545 9550 +5
=======================================
+ Hits 8843 8848 +5
Misses 702 702 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add cursor_display_position() to InputFieldState and TextAreaState that returns terminal column width using unicode-width, accounting for wide characters (emoji, CJK) that occupy 2 terminal columns. Update all 6 rendering sites to use display width instead of character count. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d7ce4bb to
0c74b85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cursor_display_position()toInputFieldStateandTextAreaStatethat returns terminal column width usingunicode-width, correctly handling wide characters (emoji, CJK) that occupy 2 terminal columnscursor_position()API unchanged (175+ test call sites)Before: Text
"A😀B"with cursor after emoji —cursor_position()returns 2, cursor renders 1 column too far leftAfter:
cursor_display_position()returns 3 (A=1col + 😀=2cols), cursor renders at correct positionTest plan
cursor_display_position()on both InputField and TextArea (ASCII, emoji, CJK, mixed, empty, multiline)cursor_position()cargo clippy --all-targets --all-features -- -D warningsclean🤖 Generated with Claude Code