@xterm/addon-webgl 0.19.0-beta.77 → 0.19.0-beta.79

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@xterm/addon-webgl",
3
- "version": "0.19.0-beta.77",
3
+ "version": "0.19.0-beta.79",
4
4
  "author": {
5
5
  "name": "The xterm.js authors",
6
6
  "url": "https://xtermjs.org/"
@@ -24,7 +24,7 @@
24
24
  "start": "node ../../demo/start"
25
25
  },
26
26
  "peerDependencies": {
27
- "@xterm/xterm": "^5.6.0-beta.77"
27
+ "@xterm/xterm": "^5.6.0-beta.79"
28
28
  },
29
- "commit": "601efc3745c797ceaebe8707850fc071afafbd4e"
29
+ "commit": "d1b01c58f8f50b147583ed15deaaaeffce442edb"
30
30
  }
@@ -377,6 +377,8 @@ export class WebglRenderer extends Disposable implements IRenderer {
377
377
  let line: IBufferLine;
378
378
  let joinedRanges: [number, number][];
379
379
  let isJoined: boolean;
380
+ let skipJoinedCheckUntilX: number = 0;
381
+ let isValidJoinRange: boolean = true;
380
382
  let lastCharX: number;
381
383
  let range: [number, number];
382
384
  let chars: string;
@@ -405,6 +407,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
405
407
  row = y + terminal.buffer.ydisp;
406
408
  line = terminal.buffer.lines.get(row)!;
407
409
  this._model.lineLengths[y] = 0;
410
+ skipJoinedCheckUntilX = 0;
408
411
  joinedRanges = this._characterJoinerService.getJoinedCharacters(row);
409
412
  for (x = 0; x < terminal.cols; x++) {
410
413
  lastBg = this._cellColorResolver.result.bg;
@@ -416,25 +419,41 @@ export class WebglRenderer extends Disposable implements IRenderer {
416
419
 
417
420
  // If true, indicates that the current character(s) to draw were joined.
418
421
  isJoined = false;
422
+
423
+ // Indicates whether this cell is part of a joined range that should be ignored as it cannot
424
+ // be rendered entirely, like the selection state differs across the range.
425
+ isValidJoinRange = (x >= skipJoinedCheckUntilX);
426
+
419
427
  lastCharX = x;
420
428
 
421
429
  // Process any joined character ranges as needed. Because of how the
422
430
  // ranges are produced, we know that they are valid for the characters
423
431
  // and attributes of our input.
424
- if (joinedRanges.length > 0 && x === joinedRanges[0][0]) {
425
- isJoined = true;
432
+ if (joinedRanges.length > 0 && x === joinedRanges[0][0] && isValidJoinRange) {
426
433
  range = joinedRanges.shift()!;
427
434
 
428
- // We already know the exact start and end column of the joined range,
429
- // so we get the string and width representing it directly.
430
- cell = new JoinedCellData(
431
- cell,
432
- line!.translateToString(true, range[0], range[1]),
433
- range[1] - range[0]
434
- );
435
-
436
- // Skip over the cells occupied by this range in the loop
437
- lastCharX = range[1] - 1;
435
+ // If the ligature's selection state is not consistent, don't join it. This helps the
436
+ // selection render correctly regardless whether they should be joined.
437
+ const firstSelectionState = this._model.selection.isCellSelected(this._terminal, range[0], row);
438
+ for (i = range[0] + 1; i < range[1]; i++) {
439
+ isValidJoinRange &&= (firstSelectionState === this._model.selection.isCellSelected(this._terminal, i, row));
440
+ }
441
+ if (!isValidJoinRange) {
442
+ skipJoinedCheckUntilX = range[1];
443
+ } else {
444
+ isJoined = true;
445
+
446
+ // We already know the exact start and end column of the joined range,
447
+ // so we get the string and width representing it directly.
448
+ cell = new JoinedCellData(
449
+ cell,
450
+ line!.translateToString(true, range[0], range[1]),
451
+ range[1] - range[0]
452
+ );
453
+
454
+ // Skip over the cells occupied by this range in the loop
455
+ lastCharX = range[1] - 1;
456
+ }
438
457
  }
439
458
 
440
459
  chars = cell.getChars();