Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! lib: add ASCII fast path to getStringWidth()
  • Loading branch information
addaleax committed Aug 25, 2019
commit 9f726cbb54756684580a7fb5f15704573d35b90a
3 changes: 2 additions & 1 deletion lib/internal/readline/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ if (internalBinding('config').hasIntl) {
getStringWidth = function getStringWidth(str, options) {
options = options || {};
if (Number.isInteger(str)) {
// Provide information about the character with code point 'str'.
return icu.getStringWidth(
str,
Boolean(options.ambiguousAsFullWidth),
Boolean(options.expandEmojiSequence)
false
);
Comment thread
bnoordhuis marked this conversation as resolved.
}
str = stripVTControlCharacters(String(str));
Expand Down