change type of IPartialLineData

This commit is contained in:
Jörg Breitbart
2018-08-27 17:11:40 +02:00
parent f964a34b34
commit de26be56c1
2 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ export class TerminalLine {
this.push(fill);
}
}
/** replace cells from pos to pos + n - 1 with fill */
public replaceCells(start: number, end: number, fill: CharData): void {
while (start < end && start < this.length) this.set(start++, fill); // Note: fill is not cloned
+2 -5
View File
@@ -260,16 +260,13 @@ describe('CharacterJoinerRegistry', () => {
});
});
interface IPartialLineData {
[0]: string;
[1]?: number;
}
type IPartialLineData = ([string] | [string, number]);
function lineData(data: IPartialLineData[]): TerminalLine {
const tline = new TerminalLine();
for (let i = 0; i < data.length; ++i) {
const line = data[i][0];
const attr = data[i][1] || 0;
const attr = <number>(data[i][1] || 0);
line.split('').map(char => tline.push([attr, char, 1, char.charCodeAt(0)]));
}
return tline;