@xterm/xterm 6.1.0-beta.303 → 6.1.0-beta.304

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/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.303",
4
+ "version": "6.1.0-beta.304",
5
5
  "main": "lib/xterm.js",
6
6
  "module": "lib/xterm.mjs",
7
7
  "style": "css/xterm.css",
@@ -119,5 +119,5 @@
119
119
  "ws": "^8.20.0",
120
120
  "xterm-benchmark": "^0.3.2"
121
121
  },
122
- "commit": "d3e32b344dfe7dd6015cff6a9aeaaeaeccdc2789"
122
+ "commit": "c58ea3637f3968e0e6e79cd92cf9aace7ef89ee2"
123
123
  }
@@ -6,4 +6,4 @@
6
6
  /**
7
7
  * The xterm.js version. This is updated by the publish script from package.json.
8
8
  */
9
- export const XTERM_VERSION = '6.1.0-beta.303';
9
+ export const XTERM_VERSION = '6.1.0-beta.304';
@@ -139,6 +139,7 @@ export class AttributeData implements IAttributeData {
139
139
  */
140
140
  export class ExtendedAttrs implements IExtendedAttrs {
141
141
  private _ext: number = 0;
142
+ public payload: Object | undefined;
142
143
  public get ext(): number {
143
144
  if (this._urlId) {
144
145
  return (
@@ -207,6 +208,6 @@ export class ExtendedAttrs implements IExtendedAttrs {
207
208
  * that needs to be persistant in the buffer.
208
209
  */
209
210
  public isEmpty(): boolean {
210
- return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0;
211
+ return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0 && this.payload === undefined;
211
212
  }
212
213
  }
@@ -208,20 +208,25 @@ export class BufferLine implements IBufferLine {
208
208
  } else {
209
209
  cell.combinedData = '';
210
210
  }
211
- if (cell.bg & BgFlags.HAS_EXTENDED) {
212
- cell.extended = this._extendedAttrs[index]!;
213
- } else {
214
- // Do not mutate cell.extended in place: it may still reference this line's map entry from a
215
- // prior loadCell into a reused CellData (e.g. $workCell during insert/delete).
216
- // We use $extended as blueprint and reset the internals
217
- // mimicking the ctor to avoid a new allocation.
218
- $extended._ext = 0;
219
- $extended._urlId = 0;
220
- cell.extended = $extended;
221
- }
211
+ cell.extended = this.getExtended(index);
222
212
  return cell;
223
213
  }
224
214
 
215
+ public getExtended(index: number): IExtendedAttrs {
216
+ $startIndex = index * Constants.CELL_INDICIES;
217
+ if (this._data[$startIndex + Cell.BG] & BgFlags.HAS_EXTENDED) {
218
+ return this._extendedAttrs[index]!;
219
+ }
220
+ // Do not mutate cell.extended in place: it may still reference this line's map entry from a
221
+ // prior loadCell into a reused CellData (e.g. $workCell during insert/delete).
222
+ // We use $extended as blueprint and reset the internals
223
+ // mimicking the ctor to avoid a new allocation.
224
+ $extended._ext = 0;
225
+ $extended._urlId = 0;
226
+ $extended.payload = undefined;
227
+ return $extended;
228
+ }
229
+
225
230
  /**
226
231
  * Set data at `index` to `cell`.
227
232
  */
@@ -20,6 +20,7 @@ export interface IExtendedAttrs {
20
20
  underlineColor: number;
21
21
  underlineVariantOffset: number;
22
22
  urlId: number;
23
+ payload: Object | undefined;
23
24
  clone(): IExtendedAttrs;
24
25
  isEmpty(): boolean;
25
26
  }
@@ -146,6 +147,7 @@ export interface IBufferLine {
146
147
  getCodePoint(index: number): number;
147
148
  isCombined(index: number): number;
148
149
  getString(index: number): string;
150
+ getExtended(index: number): IExtendedAttrs;
149
151
  }
150
152
 
151
153
  export interface IMarker extends IDisposable {