kopia lustrzana https://github.com/c9/core
fix spaces appearing after double width characters in terminal
rodzic
ef11557828
commit
592a36bcbb
|
@ -113,8 +113,11 @@ define(function(require, exports, module) {
|
|||
for (var l = Math.min(line.length, term.cols); l--;)
|
||||
if (line[l][1])
|
||||
break;
|
||||
for (var i = 0; i <= l; i++)
|
||||
str += line[i][1] || " ";
|
||||
for (var i = 0; i <= l; i++) {
|
||||
var ch = line[i][1];
|
||||
if (ch != "\x00")
|
||||
str += line[i][1] || " ";
|
||||
}
|
||||
|
||||
if (newLineChar && !line.wrapped)
|
||||
str += newLineChar;
|
||||
|
@ -546,7 +549,7 @@ define(function(require, exports, module) {
|
|||
|
||||
|
||||
if (ch <= ' ')
|
||||
out += '\xa0';
|
||||
out += ch == "\x00" ? "" : "\xa0";
|
||||
else if (ch == '&')
|
||||
out += '&';
|
||||
else if (ch == '<')
|
||||
|
|
|
@ -458,6 +458,11 @@ Terminal.prototype.writeInternal = function(data) {//TODO optimize lines
|
|||
|
||||
var width = ch > "\x7f" ? wc.charWidth(ch.charCodeAt(0)) : 1;
|
||||
line = lines[insertY];
|
||||
var x = this.x;
|
||||
while (line[x] && !line[x][1] && x > 0) {
|
||||
line[x] = [line[x][0], " "];
|
||||
x--;
|
||||
}
|
||||
switch (width) {
|
||||
case 1:
|
||||
if (!this.insertMode)
|
||||
|
@ -472,7 +477,7 @@ Terminal.prototype.writeInternal = function(data) {//TODO optimize lines
|
|||
case 2:
|
||||
if (!this.insertMode) {
|
||||
line[this.x] = [this.curAttr, ch];
|
||||
line[this.x + 1] = [this.curAttr, ""];
|
||||
line[this.x + 1] = [this.curAttr, "\x00"];
|
||||
} else {
|
||||
line[insertY].splice(this.x, 0, [this.curAttr, ch], [this.curAttr, ""]);
|
||||
}
|
||||
|
@ -700,6 +705,9 @@ Terminal.prototype.writeInternal = function(data) {//TODO optimize lines
|
|||
// change log file
|
||||
break;
|
||||
case 50:
|
||||
var args = this.params[1].match(/CursorShape=(.)/i);
|
||||
var shape = ['BLOCK', 'BEAM', 'UNDERLINE'][parseInt(args && args[1]) || 0];
|
||||
// TODO cursor shape
|
||||
// dynamic font
|
||||
break;
|
||||
case 51:
|
||||
|
|
Ładowanie…
Reference in New Issue