mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
change type of IPartialLineData
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user