diff --git a/src/TerminalLine.ts b/src/TerminalLine.ts index 7f944191..186e2f58 100644 --- a/src/TerminalLine.ts +++ b/src/TerminalLine.ts @@ -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 diff --git a/src/renderer/CharacterJoinerRegistry.test.ts b/src/renderer/CharacterJoinerRegistry.test.ts index d427ef5e..d7cd1ce4 100644 --- a/src/renderer/CharacterJoinerRegistry.test.ts +++ b/src/renderer/CharacterJoinerRegistry.test.ts @@ -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 = (data[i][1] || 0); line.split('').map(char => tline.push([attr, char, 1, char.charCodeAt(0)])); } return tline;