Wrap all characters temporarily in spans to force fixed with

Fixes #467
This commit is contained in:
Daniel Imms
2017-05-07 16:08:01 -07:00
parent 23e6a475ee
commit 3baa6b9237
3 changed files with 14 additions and 4 deletions
+9 -2
View File
@@ -283,8 +283,12 @@ export class Renderer {
} }
} }
// TODO: Consider performance implications of not pulling these from the pool
if (ch_width === 2) { if (ch_width === 2) {
out += '<span class="xterm-wide-char">'; innerHTML += '<span class="xterm-wide-char">';
} else {
// TODO: Only wrap unicode characters that may vary in width
innerHTML += '<span class="xterm-normal-char">';
} }
switch (ch) { switch (ch) {
case '&': case '&':
@@ -310,7 +314,10 @@ export class Renderer {
break; break;
} }
if (ch_width === 2) { if (ch_width === 2) {
out += '</span>'; innerHTML += '</span>';
} else {
// TODO: Only wrap unicode characters that may vary in width
innerHTML += '</span>';
} }
attr = data; attr = data;
+2 -1
View File
@@ -153,7 +153,8 @@
overflow-y: scroll; overflow-y: scroll;
} }
.terminal .xterm-wide-char { .terminal .xterm-wide-char,
.terminal .xterm-normal-char {
display: inline-block; display: inline-block;
} }
+3 -1
View File
@@ -760,7 +760,9 @@ Terminal.loadAddon = function(addon, callback) {
* character width has been changed. * character width has been changed.
*/ */
Terminal.prototype.updateCharSizeCSS = function() { Terminal.prototype.updateCharSizeCSS = function() {
this.charSizeStyleElement.textContent = '.xterm-wide-char{width:' + (this.charMeasure.width * 2) + 'px;}'; this.charSizeStyleElement.textContent =
'.xterm-wide-char{width:' + (this.charMeasure.width * 2) + 'px;}' +
'.xterm-normal-char{width:' + this.charMeasure.width + 'px;}'
} }
/** /**