Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Borders displayed too long in environment with East Asian Ambiguous Width == 2 #1727

Open
aoyama-val opened this issue Jun 22, 2024 · 2 comments

Comments

@aoyama-val
Copy link

A lot of CJK environments assume that East Asian Ambiguous Width characters are double width, whereas Eastern enviroments single. In former, the borders are displayed with double width and wrapped.It would be preferrable if there was an option to treat those characters as double width or to use ASCII characters to draw borders.

To reproduce:

  • Use a terminal that is configurable so that Ambiguous Width characters are double width (e.g. iTerm2)

screenshot 2024-06-23 2 09 28

screenshot 2024-06-23 2 13 28

@th1000s
Copy link
Collaborator

th1000s commented Aug 5, 2024

I see, delta is using ambiguous chars there, e.g. BOX DRAWINGS LIGHT HORIZONTAL, full list at https://www.unicode.org/reports/tr11-2/.

Also, when determining the width of chars in the diff itself UnicodeWidthStr::width() is always called with no option to switch to width_cjk(). This is most noticeable in side-by-side views so you may also have seen that.

@th1000s
Copy link
Collaborator

th1000s commented Sep 8, 2024

FTR: On Linux, GNOME Terminal supports setting ambiguous chars to double width (have not found other terms yet). Preferences -> Profile -> Tab "Compatibility" -> Ambiguous-width characters: Wide

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

No branches or pull requests

2 participants