@xterm/xterm 6.1.0-beta.270 → 6.1.0-beta.272
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xterm.js +1 -1
- package/lib/xterm.js.map +1 -1
- package/lib/xterm.mjs +4 -4
- package/lib/xterm.mjs.map +3 -3
- package/package.json +5 -5
- package/src/common/Version.ts +1 -1
- package/src/common/buffer/BufferLine.ts +32 -29
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/xterm",
|
|
3
3
|
"description": "Full xterm terminal, in your browser",
|
|
4
|
-
"version": "6.1.0-beta.
|
|
4
|
+
"version": "6.1.0-beta.272",
|
|
5
5
|
"main": "lib/xterm.js",
|
|
6
6
|
"module": "lib/xterm.mjs",
|
|
7
7
|
"style": "css/xterm.css",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"test-integration-firefox": "node ./bin/test_integration.js --workers=75% \"--project=FirefoxStable\"",
|
|
62
62
|
"test-integration-webkit": "node ./bin/test_integration.js --workers=75% \"--project=WebKit\"",
|
|
63
63
|
"test-integration-debug": "node ./bin/test_integration.js --workers=1 --headed --timeout=30000",
|
|
64
|
-
"benchmark": "xterm-benchmark -r 5 -c test/benchmark/benchmark.json",
|
|
65
|
-
"benchmark-baseline": "xterm-benchmark -r 5 -c test/benchmark/benchmark.json --baseline out-test/benchmark/*benchmark.js",
|
|
66
|
-
"benchmark-eval": "xterm-benchmark -r 5 -c test/benchmark/benchmark.json --eval out-test/benchmark/*benchmark.js",
|
|
64
|
+
"benchmark": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json",
|
|
65
|
+
"benchmark-baseline": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json --baseline out-test/benchmark/*benchmark.js",
|
|
66
|
+
"benchmark-eval": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json --eval out-test/benchmark/*benchmark.js",
|
|
67
67
|
"clean": "rm -rf lib out addons/*/lib addons/*/out",
|
|
68
68
|
"vtfeatures": "node bin/extract_vtfeatures.js src/*/*.ts src/*/*/*.ts src/*.ts addons/**/src/*.ts",
|
|
69
69
|
"prepackage": "npm run build",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"ws": "^8.20.0",
|
|
117
117
|
"xterm-benchmark": "^0.3.2"
|
|
118
118
|
},
|
|
119
|
-
"commit": "
|
|
119
|
+
"commit": "b3de9fa6db6a9278e4e16808c137e423f49ac896"
|
|
120
120
|
}
|
package/src/common/Version.ts
CHANGED
|
@@ -73,7 +73,9 @@ export interface IBufferLineStringCache {
|
|
|
73
73
|
*/
|
|
74
74
|
export class BufferLine implements IBufferLine {
|
|
75
75
|
protected _data: Uint32Array;
|
|
76
|
+
/** Sparse cache; only read when `IS_COMBINED_MASK` is set in `_data`. */
|
|
76
77
|
protected _combined: {[index: number]: string} = {};
|
|
78
|
+
/** Sparse cache; only read when `HAS_EXTENDED` is set in `_data`. */
|
|
77
79
|
protected _extendedAttrs: {[index: number]: IExtendedAttrs | undefined} = {};
|
|
78
80
|
protected _stringCacheEntryRef: WeakRef<IBufferLineStringCacheEntry> | undefined;
|
|
79
81
|
public length: number;
|
|
@@ -205,9 +207,15 @@ export class BufferLine implements IBufferLine {
|
|
|
205
207
|
cell.bg = this._data[$startIndex + Cell.BG];
|
|
206
208
|
if (cell.content & Content.IS_COMBINED_MASK) {
|
|
207
209
|
cell.combinedData = this._combined[index];
|
|
210
|
+
} else {
|
|
211
|
+
cell.combinedData = '';
|
|
208
212
|
}
|
|
209
213
|
if (cell.bg & BgFlags.HAS_EXTENDED) {
|
|
210
214
|
cell.extended = this._extendedAttrs[index]!;
|
|
215
|
+
} else {
|
|
216
|
+
// Do not mutate cell.extended in place: it may still reference this line's map entry from a
|
|
217
|
+
// prior loadCell into a reused CellData (e.g. $workCell during insert/delete).
|
|
218
|
+
cell.extended = DEFAULT_ATTR_DATA.extended.clone();
|
|
211
219
|
}
|
|
212
220
|
return cell;
|
|
213
221
|
}
|
|
@@ -459,14 +467,7 @@ export class BufferLine implements IBufferLine {
|
|
|
459
467
|
this._data.set(line._data);
|
|
460
468
|
}
|
|
461
469
|
this.length = line.length;
|
|
462
|
-
this.
|
|
463
|
-
for (const el in line._combined) {
|
|
464
|
-
this._combined[el] = line._combined[el];
|
|
465
|
-
}
|
|
466
|
-
this._extendedAttrs = {};
|
|
467
|
-
for (const el in line._extendedAttrs) {
|
|
468
|
-
this._extendedAttrs[el] = line._extendedAttrs[el];
|
|
469
|
-
}
|
|
470
|
+
this._copySparseMapsFrom(line);
|
|
470
471
|
this.isWrapped = line.isWrapped;
|
|
471
472
|
}
|
|
472
473
|
|
|
@@ -475,12 +476,7 @@ export class BufferLine implements IBufferLine {
|
|
|
475
476
|
const newLine = new BufferLine(this._stringCache, 0, undefined, false);
|
|
476
477
|
newLine._data = new Uint32Array(this._data);
|
|
477
478
|
newLine.length = this.length;
|
|
478
|
-
|
|
479
|
-
newLine._combined[el] = this._combined[el];
|
|
480
|
-
}
|
|
481
|
-
for (const el in this._extendedAttrs) {
|
|
482
|
-
newLine._extendedAttrs[el] = this._extendedAttrs[el];
|
|
483
|
-
}
|
|
479
|
+
newLine._copySparseMapsFrom(this);
|
|
484
480
|
newLine.isWrapped = this.isWrapped;
|
|
485
481
|
return newLine;
|
|
486
482
|
}
|
|
@@ -511,27 +507,14 @@ export class BufferLine implements IBufferLine {
|
|
|
511
507
|
for (let i = 0; i < Constants.CELL_INDICIES; i++) {
|
|
512
508
|
this._data[(destCol + cell) * Constants.CELL_INDICIES + i] = srcData[(srcCol + cell) * Constants.CELL_INDICIES + i];
|
|
513
509
|
}
|
|
514
|
-
|
|
515
|
-
this._extendedAttrs[destCol + cell] = src._extendedAttrs[srcCol + cell];
|
|
516
|
-
}
|
|
510
|
+
this._copyCellMapsFrom(src, srcCol + cell, destCol + cell);
|
|
517
511
|
}
|
|
518
512
|
} else {
|
|
519
513
|
for (let cell = 0; cell < length; cell++) {
|
|
520
514
|
for (let i = 0; i < Constants.CELL_INDICIES; i++) {
|
|
521
515
|
this._data[(destCol + cell) * Constants.CELL_INDICIES + i] = srcData[(srcCol + cell) * Constants.CELL_INDICIES + i];
|
|
522
516
|
}
|
|
523
|
-
|
|
524
|
-
this._extendedAttrs[destCol + cell] = src._extendedAttrs[srcCol + cell];
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
// Move any combined data over as needed, FIXME: repeat for extended attrs
|
|
530
|
-
const srcCombinedKeys = Object.keys(src._combined);
|
|
531
|
-
for (let i = 0; i < srcCombinedKeys.length; i++) {
|
|
532
|
-
const key = parseInt(srcCombinedKeys[i], 10);
|
|
533
|
-
if (key >= srcCol) {
|
|
534
|
-
this._combined[key - srcCol + destCol] = src._combined[key];
|
|
517
|
+
this._copyCellMapsFrom(src, srcCol + cell, destCol + cell);
|
|
535
518
|
}
|
|
536
519
|
}
|
|
537
520
|
}
|
|
@@ -620,4 +603,24 @@ export class BufferLine implements IBufferLine {
|
|
|
620
603
|
cacheEntry.isTrimmed = false;
|
|
621
604
|
}
|
|
622
605
|
}
|
|
606
|
+
|
|
607
|
+
/** Copy sparse map entries for a single cell when `_data` flags require them. */
|
|
608
|
+
private _copyCellMapsFrom(src: BufferLine, srcCol: number, destCol: number): void {
|
|
609
|
+
const srcStart = srcCol * Constants.CELL_INDICIES;
|
|
610
|
+
if (src._data[srcStart + Cell.CONTENT] & Content.IS_COMBINED_MASK) {
|
|
611
|
+
this._combined[destCol] = src._combined[srcCol];
|
|
612
|
+
}
|
|
613
|
+
if (src._data[srcStart + Cell.BG] & BgFlags.HAS_EXTENDED) {
|
|
614
|
+
this._extendedAttrs[destCol] = src._extendedAttrs[srcCol];
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/** Rebuild sparse maps from another line, keyed only by `_data` flags. */
|
|
619
|
+
private _copySparseMapsFrom(line: BufferLine): void {
|
|
620
|
+
this._combined = {};
|
|
621
|
+
this._extendedAttrs = {};
|
|
622
|
+
for (let i = 0; i < line.length; i++) {
|
|
623
|
+
this._copyCellMapsFrom(line, i, i);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
623
626
|
}
|