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
readline: handle 𐀀 character correctly
  • Loading branch information
Avi-D-coder committed Feb 22, 2019
commit e649085f9caae093d45bf05c7af4c72d0815c5c5
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;
}
Comment thread
Avi-D-coder marked this conversation as resolved.

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