fix: table handles full-width characters @W-22163225@#289
Merged
Conversation
|
Git2Gus App is installed but the |
jfeingold35
commented
Apr 27, 2026
Comment on lines
+1
to
+11
| ┌──────────────────┬─────────────────────────────────────────┐ | ||
| │ C1 │ C2 │ | ||
| ├──────────────────┼─────────────────────────────────────────┤ | ||
| │ first row value │ a string with only normal chars │ | ||
| ├──────────────────┼─────────────────────────────────────────┤ | ||
| │ second row value │ a string with Japanese chars: ワイド │ | ||
| ├──────────────────┼─────────────────────────────────────────┤ | ||
| │ third row value │ a string with emoji: 🍁🍁 │ | ||
| ├──────────────────┼─────────────────────────────────────────┤ | ||
| │ fourth row value │ a string with full-width latin: ABC. │ | ||
| └──────────────────┴─────────────────────────────────────────┘ |
Contributor
Author
There was a problem hiding this comment.
soridalac
approved these changes
Apr 28, 2026
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Resolves a bug wherein strings that use full-width characters (e.g., 'ABC' or 'ワイド') would print with table margins misaligned.
The cause of the bug was that all margins and spacing were being determined with
String.length, which treats all of those full-width characters as being one character long instead of two. This explains why the issue didn't occur for emoji, since emoji count as length-2 instead of length-1.The fix was to pull
string-width, which was previously a nested dependency via other libraries, into a top-level dependency and use it in the places where we'd previously been usingString.length.string-widthreturns a string's visual width rather than its strict character length, so the table is now rendered properly.GH issue related: forcedotcom/cli#3538
@W-22163225@