You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: optimize Unicode width calculation based on iblea feedback
Per iblea's suggestion in PR #563, added comprehensive Korean and Japanese
character detection with checkAsianCharacter() helper function covering:
- Korean Hangul (unicode.Hangul)
- Korean Jamo ranges (0x1100-0x11FF, 0x3130-0x318F)
- Japanese Hiragana and Katakana (unicode.Hiragana, unicode.Katakana)
- Enclosed CJK Letters (0x3200-0x32FF)
Key insight discovered during implementation:
ansi.StringWidth already handles CJK characters correctly, so we only
need the runewidth fallback for emoji and special symbols. This keeps
table rendering consistent while improving emoji support.
Changes:
- Simplified stringWidth() to always use fallback for emoji
- Removed CJK from containsComplexUnicode() detection
- Updated tests to reflect that CJK is handled by ansi.StringWidth
- All tests pass including table width constraints
π€ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments