Fix insert chars

This commit is contained in:
Florian Mounier
2015-04-21 11:59:42 +02:00
parent 23c905e05e
commit 9a58059c1d
4 changed files with 11 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1895,19 +1895,18 @@
}; };
Terminal.prototype.insertChars = function(params) { Terminal.prototype.insertChars = function(params) {
var j, param, results, row; var j, param, row;
param = params[0]; param = params[0];
if (param < 1) { if (param < 1) {
param = 1; param = 1;
} }
row = this.y; row = this.y;
j = this.x; j = this.x;
results = [];
while (param-- && j < this.cols) { while (param-- && j < this.cols) {
this.screen[row + this.shift].splice(j++, 0, [this.eraseAttr(), true]); this.screen[row + this.shift][0].splice(j++, 0, [this.eraseAttr(), true]);
results.push(this.screen[row + this.shift].pop()); this.screen[row + this.shift][0].pop();
} }
return results; return this.screen[row + this.shift][1] = true;
}; };
Terminal.prototype.cursorNextLine = function(params) { Terminal.prototype.cursorNextLine = function(params) {

File diff suppressed because one or more lines are too long

View File

@@ -1866,8 +1866,9 @@ class Terminal
j = @x j = @x
# xterm # xterm
while param-- and j < @cols while param-- and j < @cols
@screen[row + @shift].splice j++, 0, [@eraseAttr(), true] @screen[row + @shift][0].splice j++, 0, [@eraseAttr(), true]
@screen[row + @shift].pop() @screen[row + @shift][0].pop()
@screen[row + @shift][1] = true
# CSI Ps E # CSI Ps E