change insertCells to new interface

This commit is contained in:
Jörg Breitbart
2019-01-12 14:34:29 +01:00
parent ad67f47acb
commit 88a037b309
4 changed files with 14 additions and 10 deletions
+3 -5
View File
@@ -279,20 +279,18 @@ export class BufferLine implements IBufferLine {
}
}
public insertCells(pos: number, n: number, fillCharData: CharData): void {
public insertCells(pos: number, n: number, fillCellData: ICellData): void {
pos %= this.length;
if (n < this.length - pos) {
for (let i = this.length - pos - n - 1; i >= 0; --i) {
this.setCell(pos + n + i, this.loadCell(pos + i, this._cell));
}
this._cell.setFromCharData(fillCharData);
for (let i = 0; i < n; ++i) {
this.setCell(pos + i, this._cell);
this.setCell(pos + i, fillCellData);
}
} else {
this._cell.setFromCharData(fillCharData);
for (let i = pos; i < this.length; ++i) {
this.setCell(i, this._cell);
this.setCell(i, fillCellData);
}
}
}