-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update wcwidth/CharWidth.ts #1707
Changes from 5 commits
fae8a19
0f1955a
cfc1a58
48bd634
e807d85
a76907e
1c33493
acbca7a
993b8c2
2ae864b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,5 +75,12 @@ describe('getStringCellWidth', function(): void { | |
assert.equal(input, s); | ||
assert.equal(getStringCellWidth(s), sumWidths(terminal.buffer, 0, 1, '#')); | ||
}); | ||
it('wide emojis', function(): void { | ||
const input = '😀😀🌖🌖🍆🍆'; | ||
terminal.writeSync(input); | ||
const s = terminal.buffer.iterator(true).next().content; | ||
assert.equal(input, s); | ||
assert.equal(getStringCellWidth(s), 12); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Due to #1685 you can temporarily fix your test case by placing a whitespace after every second emoji char. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test wasn't breaking, it was another existing one ("Lots of makes me ." - smiley just happend to occur after a break in the buffer, leaving an extra space) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yupp my bad, the line isnt wrapping (mixed cols and rows in my head). |
||
// TODO: multiline tests once #1685 is resolved | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address this with a separate PR. The test case tested the wrong behavior by purpose to track it.