diff --git a/lib/widget.js b/lib/widget.js index 9b93bad..566aa59 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -4011,9 +4011,9 @@ Element.prototype.render = function() { } if (this.screen.fullUnicode && content[ci - 1]) { + var point = unicode.codePointAt(content, ci - 1); // Handle combining chars: // Make sure they get in the same cell and are counted as 0. - var point = unicode.codePointAt(content, ci - 1); if (unicode.combining[point]) { if (point > 0x00ffff) { ch = content[ci - 1] + content[ci]; @@ -4029,17 +4029,9 @@ Element.prototype.render = function() { } // Handle surrogate pairs: // Make sure we put surrogate pair chars in one cell. - var code = content[ci - 1].charCodeAt(0); - // if (unicode.codePointAt(content, ci - 1) > 0x00ffff) { - // if (unicode.isSurrogate(content, ci - 1) { - if (code >= 0xd800 && code <= 0xdbff) { - var code2 = (content[ci] || '').charCodeAt(0); - if (code2 >= 0xdc00 && code2 <= 0xdfff) { - ch = content[ci - 1] + content[ci]; - ci++; - } else { - ch = bch; - } + if (point > 0x00ffff) { + ch = content[ci - 1] + content[ci]; + ci++; } }