Summary
get_character_cell_size() currently returns a width of 1 for East Asian Width (EAW) ambiguous characters.
Many CJK terminals render these characters using two cells, which can lead to incorrect text alignment.
This PR updates the fallback logic to return 2 for characters whose East Asian Width category is "A".
Testing
- Verified that
get_character_cell_size("…") previously returned 1.
- Verified that it now returns
2.
- Added/updated tests for the new behavior.
Summary
get_character_cell_size()currently returns a width of1for East Asian Width (EAW) ambiguous characters.Many CJK terminals render these characters using two cells, which can lead to incorrect text alignment.
This PR updates the fallback logic to return
2for characters whose East Asian Width category is"A".Testing
get_character_cell_size("…")previously returned1.2.