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

Set EastAsianWidth to fix broken layout #71

Merged
merged 1 commit into from
Dec 5, 2022

Conversation

egawata
Copy link
Contributor

@egawata egawata commented Aug 12, 2022

Box layout in the top of screen is broken when using CJK locales.

The following is a screenshot, using MacOS 12.4, iTerm2 3.4.16, and LANG=ja_JP.UTF-8

スクリーンショット 2022-08-12 23 54 17

The first letter of titles aren't displayed, and box layout is broken.

The reason is that those box-drawing characters are ambiguous width ones, which will be displayed with a narrow width with non-CJK locales, but with wide width with CJK, which would break layout.
One way to fix it is to override DefaultCondition.EastAsianWidth variable in go-runewidth with false, so that any ambiguous width charactes would always be displayed with narrow width.

@egawata egawata changed the title fix: set eastasian width to fix broken layout Set EastAsianWidth to fix broken layout Aug 12, 2022
@sachaos
Copy link
Owner

sachaos commented Aug 30, 2022

Sorry for late.
I'll check soon.

Copy link
Owner

@sachaos sachaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sachaos sachaos merged commit a251280 into sachaos:master Dec 5, 2022
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.

2 participants