wcwidth only for printables
This commit is contained in:
+3
-16
@@ -1388,7 +1388,7 @@
|
|||||||
for (; i < width; i++) {
|
for (; i < width; i++) {
|
||||||
data = line[i][0];
|
data = line[i][0];
|
||||||
ch = line[i][1];
|
ch = line[i][1];
|
||||||
ch_width = line[i][2] || 1;
|
ch_width = line[i][2];
|
||||||
if (!ch_width)
|
if (!ch_width)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1490,7 +1490,6 @@
|
|||||||
if (ch <= ' ') {
|
if (ch <= ' ') {
|
||||||
out += ' ';
|
out += ' ';
|
||||||
} else {
|
} else {
|
||||||
if (ch_width==2) i++;
|
|
||||||
out += ch;
|
out += ch;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1614,9 +1613,6 @@
|
|||||||
if (0xDC00 <= code && code <= 0xDFFF)
|
if (0xDC00 <= code && code <= 0xDFFF)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ch_width = wcswidth(code);
|
|
||||||
|
|
||||||
|
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case normal:
|
case normal:
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
@@ -1672,6 +1668,8 @@
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
// ' '
|
// ' '
|
||||||
|
ch_width = wcswidth(code); // expensive, therefore we save the result in line buffer
|
||||||
|
|
||||||
if (ch >= ' ') {
|
if (ch >= ' ') {
|
||||||
if (this.charset && this.charset[ch]) {
|
if (this.charset && this.charset[ch]) {
|
||||||
ch = this.charset[ch];
|
ch = this.charset[ch];
|
||||||
@@ -4743,17 +4741,6 @@
|
|||||||
return thirdLevelKey && (!ev.keyCode || ev.keyCode > 47);
|
return thirdLevelKey && (!ev.keyCode || ev.keyCode > 47);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isWide(ch) {
|
|
||||||
if (ch <= '\uff00') return false;
|
|
||||||
return (ch >= '\uff01' && ch <= '\uffbe')
|
|
||||||
|| (ch >= '\uffc2' && ch <= '\uffc7')
|
|
||||||
|| (ch >= '\uffca' && ch <= '\uffcf')
|
|
||||||
|| (ch >= '\uffd2' && ch <= '\uffd7')
|
|
||||||
|| (ch >= '\uffda' && ch <= '\uffdc')
|
|
||||||
|| (ch >= '\uffe0' && ch <= '\uffe6')
|
|
||||||
|| (ch >= '\uffe8' && ch <= '\uffee');
|
|
||||||
}
|
|
||||||
|
|
||||||
function matchColor(r1, g1, b1) {
|
function matchColor(r1, g1, b1) {
|
||||||
var hash = (r1 << 16) | (g1 << 8) | b1;
|
var hash = (r1 << 16) | (g1 << 8) | b1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user