Skip to content

Commit

Permalink
readline: handle 𐀀 character correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-D-coder committed Feb 22, 2019
1 parent 1b9ea93 commit e649085
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,8 @@ Interface.prototype._wordRight = function() {
function charLengthLeft(str, i) {
if (i <= 0)
return 0;
if (i > 1 && str.codePointAt(i - 2) > 2 ** 16 ||
str.codePointAt(i - 1) > 2 ** 16) {
if (i > 1 && str.codePointAt(i - 2) >= 2 ** 16 ||
str.codePointAt(i - 1) >= 2 ** 16) {
return 2;
}
return 1;
Expand All @@ -598,7 +598,7 @@ function charLengthLeft(str, i) {
function charLengthAt(str, i) {
if (str.length <= i)
return 0;
return str.codePointAt(i) > 2 ** 16 ? 2 : 1;
return str.codePointAt(i) >= 2 ** 16 ? 2 : 1;
}

Interface.prototype._deleteLeft = function() {
Expand Down

0 comments on commit e649085

Please sign in to comment.