Only wrap single width unicode chars
This commit is contained in:
+23
-33
@@ -283,41 +283,31 @@ export class Renderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Consider performance implications of not pulling these from the pool
|
|
||||||
if (ch_width === 2) {
|
if (ch_width === 2) {
|
||||||
innerHTML += '<span class="xterm-wide-char">';
|
// Wrap wide characters so they're sized correctly
|
||||||
|
innerHTML += `<span class="xterm-wide-char">${ch}</span>`;
|
||||||
|
} else if (ch.charCodeAt(0) > 255) {
|
||||||
|
// Wrap any non-wide unicode character as some fonts size them badly
|
||||||
|
innerHTML += `<span class="xterm-normal-char">${ch}</span>`;
|
||||||
} else {
|
} else {
|
||||||
// TODO: Only wrap unicode characters that may vary in width
|
switch (ch) {
|
||||||
innerHTML += '<span class="xterm-normal-char">';
|
case '&':
|
||||||
}
|
innerHTML += '&';
|
||||||
switch (ch) {
|
break;
|
||||||
case '&':
|
case '<':
|
||||||
innerHTML += '&';
|
innerHTML += '<';
|
||||||
//out += '&';
|
break;
|
||||||
break;
|
case '>':
|
||||||
case '<':
|
innerHTML += '>';
|
||||||
innerHTML += '<';
|
break;
|
||||||
//out += '<';
|
default:
|
||||||
break;
|
if (ch <= ' ') {
|
||||||
case '>':
|
innerHTML += ' ';
|
||||||
innerHTML += '>';
|
} else {
|
||||||
//out += '>';
|
innerHTML += ch;
|
||||||
break;
|
}
|
||||||
default:
|
break;
|
||||||
if (ch <= ' ') {
|
}
|
||||||
innerHTML += ' ';
|
|
||||||
//out += ' ';
|
|
||||||
} else {
|
|
||||||
innerHTML += ch;
|
|
||||||
// out += ch;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (ch_width === 2) {
|
|
||||||
innerHTML += '</span>';
|
|
||||||
} else {
|
|
||||||
// TODO: Only wrap unicode characters that may vary in width
|
|
||||||
innerHTML += '</span>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attr = data;
|
attr = data;
|
||||||
|
|||||||
Reference in New Issue
Block a user