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

Fix whitespace padding width with tabs and Unicode combining characters #1717

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

exyi
Copy link
Member

@exyi exyi commented Oct 19, 2023

Tabs are replaced by tabs to preserve the string width, all other characters are replaced by a single space. Moreover we now count the unicode graphemes instead of UTF16 units. It still has the problem that some characters (Emoji, CJK) are wider even in monospace fonts, but that's not that easy to determine.

Before:
image

Now:
image

The 2 spaces after the emoji is actually a bug in the terminal emulator I use.

Tabs are replaced by tabs to preserve the string width,
all other characters are replaced by a single space.
Moreover we now count the unicode graphemes instead of UTF16 units.
It still has the problem that some characters (Emoji, CJK) are wider even
in monospace fonts, but that's not that easy to determine.
@tomasherceg tomasherceg merged commit c599b7f into main Oct 22, 2023
14 checks passed
@tomasherceg tomasherceg deleted the log-warning-fix-padding branch October 22, 2023 08:00
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