fix combining check during unicode wrap.

This commit is contained in:
Christopher Jeffrey 2015-04-27 14:08:18 -07:00
parent 53066c8f4c
commit f8946a22f3
2 changed files with 3 additions and 3 deletions

View File

@ -447,7 +447,7 @@ exports.combining = exports.combiningTable.reduce(function(out, row) {
return out; return out;
}, {}); }, {});
exports.isNonSpacing = function(str, i) { exports.isCombining = function(str, i) {
var point = typeof str !== 'number' var point = typeof str !== 'number'
? exports.codePointAt(str, i || 0) ? exports.codePointAt(str, i || 0)
: str; : str;

View File

@ -2736,14 +2736,14 @@ main:
if (line[j] === ' ' if (line[j] === ' '
|| line[j] === '\x03' || line[j] === '\x03'
|| (unicode.isSurrogate(line, j - 1) && line[j + 1] !== '\x03') || (unicode.isSurrogate(line, j - 1) && line[j + 1] !== '\x03')
|| unicode.combining[line[j]]) { || unicode.isCombining(line, j)) {
break; break;
} }
} }
if (line[j] === ' ' if (line[j] === ' '
|| line[j] === '\x03' || line[j] === '\x03'
|| (unicode.isSurrogate(line, j - 1) && line[j + 1] !== '\x03') || (unicode.isSurrogate(line, j - 1) && line[j + 1] !== '\x03')
|| unicode.combining[line[j]]) { || unicode.isCombining(line, j)) {
i = j + 1; i = j + 1;
} }
} }