MCPcopy
hub / github.com/xtermjs/xterm.js / lineData

Function lineData

src/browser/services/CharacterJoinerService.test.ts:269–279  ·  view source on GitHub ↗
(data: IPartialLineData[])

Source from the content-addressed store, hash-verified

267type IPartialLineData = ([string] | [string, number]);
268
269function lineData(data: IPartialLineData[]): IBufferLine {
270 const tline = new BufferLine(0);
271 for (let i = 0; i < data.length; ++i) {
272 const line = data[i][0];
273 const attr = (data[i][1] || 0) as number;
274 const offset = tline.length;
275 tline.resize(tline.length + line.split('').length, CellData.fromCharData([0, '', 0, 0]));
276 line.split('').map((char, idx) => tline.setCell(idx + offset, CellData.fromCharData([attr, char, 1, char.charCodeAt(0)])));
277 }
278 return tline;
279}
280
281function substringJoiner(substring: string): (sequence: string) => [number, number][] {
282 return (sequence: string): [number, number][] => {

Callers 1

Calls 4

resizeMethod · 0.95
setCellMethod · 0.95
fromCharDataMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected