change deleteCells to new interface

This commit is contained in:
Jörg Breitbart
2019-01-12 14:58:30 +01:00
parent 523ff6e5fc
commit 4bf7f3eb89
4 changed files with 6 additions and 8 deletions
+3 -5
View File
@@ -295,20 +295,18 @@ export class BufferLine implements IBufferLine {
}
}
public deleteCells(pos: number, n: number, fillCharData: CharData): void {
public deleteCells(pos: number, n: number, fillCellData: ICellData): void {
pos %= this.length;
if (n < this.length - pos) {
for (let i = 0; i < this.length - pos - n; ++i) {
this.setCell(pos + i, this.loadCell(pos + n + i, this._cell));
}
this._cell.setFromCharData(fillCharData);
for (let i = this.length - n; i < this.length; ++i) {
this.setCell(i, this._cell);
this.setCell(i, fillCellData);
}
} else {
this._cell.setFromCharData(fillCharData);
for (let i = pos; i < this.length; ++i) {
this.setCell(i, this._cell);
this.setCell(i, fillCellData);
}
}
}