Skip to content

Fix alignment of multi-byte fullwidth character comments #575

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

Merged
merged 1 commit into from
Sep 9, 2018

Conversation

oieioi
Copy link
Contributor

@oieioi oieioi commented Sep 8, 2018

This fixes alignment of Japanese, Korean and Chinese fullwidth character comments.

The displayed widths of multi-byte fullwidth characters are generally
twice as large as the ASCII characters, but String#size returns only the number of characters.
So if the column comment contains fullwidth multibyte characters, the alignment is broken.

Monospaced font-family supporting multi-byte isn't used in GitHub diff view, you can confirm the fixed alignment with font-family: "Osaka-mono", "MS Gothic";.

cf. https://gyazo.com/d878a077b7494f07bcc45ecf7c0adb62

@oieioi oieioi force-pushed the feature/multibyte-comment branch 2 times, most recently from 5b0a312 to c1f9d8a Compare September 8, 2018 11:34
This fixes alignment of Japanese, Korean and Chinese fullwidth character comments.

The displayed widths of multi-byte fullwidth characters are generally
twice as large as the ASCII characters, but String#size returns only the number of characters.
So if the column comment contains fullwidth multibyte characters, the alignment is broken.
@oieioi oieioi force-pushed the feature/multibyte-comment branch from c1f9d8a to ccc6590 Compare September 8, 2018 11:43
@ctran ctran added this to the v.2.7.5 milestone Sep 9, 2018
@ctran ctran merged commit 2614266 into ctran:develop Sep 9, 2018
@ctran
Copy link
Owner

ctran commented Sep 9, 2018

Thanks!

@ctran ctran added the bug label Sep 9, 2018
mgpnd pushed a commit to mgpnd/annotate_models that referenced this pull request Feb 15, 2019
This fixes alignment of Japanese, Korean and Chinese fullwidth character comments.

The displayed widths of multi-byte fullwidth characters are generally
twice as large as the ASCII characters, but String#size returns only the number of characters.
So if the column comment contains fullwidth multibyte characters, the alignment is broken.
@oieioi oieioi deleted the feature/multibyte-comment branch March 2, 2022 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants