@xterm/xterm 5.6.0-beta.17 → 5.6.0-beta.19

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": "5.6.0-beta.17",
4
+ "version": "5.6.0-beta.19",
5
5
  "main": "lib/xterm.js",
6
6
  "style": "css/xterm.css",
7
7
  "types": "typings/xterm.d.ts",
@@ -355,6 +355,12 @@ const enum VectorType {
355
355
  * Original symbols defined in https://github.com/powerline/fontpatcher
356
356
  */
357
357
  export const powerlineDefinitions: { [index: string]: IVectorShape } = {
358
+ // Git branch
359
+ '\u{E0A0}': { d: 'M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655', type: VectorType.FILL },
360
+ // L N
361
+ '\u{E0A1}': { d: 'M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5', type: VectorType.FILL },
362
+ // Lock
363
+ '\u{E0A2}': { d: 'M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82', type: VectorType.FILL },
358
364
  // Right triangle solid
359
365
  '\u{E0B0}': { d: 'M0,0 L1,.5 L0,1', type: VectorType.FILL, rightPadding: 2 },
360
366
  // Right triangle line
@@ -20,23 +20,18 @@ export interface IEventEmitter<T, U = void> {
20
20
  }
21
21
 
22
22
  export class EventEmitter<T, U = void> implements IEventEmitter<T, U> {
23
- private _listeners: IListener<T, U>[] = [];
23
+ private _listeners: Set<IListener<T, U>> = new Set();
24
24
  private _event?: IEvent<T, U>;
25
25
  private _disposed: boolean = false;
26
26
 
27
27
  public get event(): IEvent<T, U> {
28
28
  if (!this._event) {
29
29
  this._event = (listener: (arg1: T, arg2: U) => any) => {
30
- this._listeners.push(listener);
30
+ this._listeners.add(listener);
31
31
  const disposable = {
32
32
  dispose: () => {
33
33
  if (!this._disposed) {
34
- for (let i = 0; i < this._listeners.length; i++) {
35
- if (this._listeners[i] === listener) {
36
- this._listeners.splice(i, 1);
37
- return;
38
- }
39
- }
34
+ this._listeners.delete(listener);
40
35
  }
41
36
  }
42
37
  };
@@ -48,8 +43,8 @@ export class EventEmitter<T, U = void> implements IEventEmitter<T, U> {
48
43
 
49
44
  public fire(arg1: T, arg2: U): void {
50
45
  const queue: IListener<T, U>[] = [];
51
- for (let i = 0; i < this._listeners.length; i++) {
52
- queue.push(this._listeners[i]);
46
+ for (const l of this._listeners.values()) {
47
+ queue.push(l);
53
48
  }
54
49
  for (let i = 0; i < queue.length; i++) {
55
50
  queue[i].call(undefined, arg1, arg2);
@@ -63,7 +58,7 @@ export class EventEmitter<T, U = void> implements IEventEmitter<T, U> {
63
58
 
64
59
  public clearListeners(): void {
65
60
  if (this._listeners) {
66
- this._listeners.length = 0;
61
+ this._listeners.clear();
67
62
  }
68
63
  }
69
64
  }
@@ -611,8 +611,8 @@ export class Buffer implements IBuffer {
611
611
  this._isClearing = true;
612
612
  for (let i = 0; i < this.markers.length; i++) {
613
613
  this.markers[i].dispose();
614
- this.markers.splice(i--, 1);
615
614
  }
615
+ this.markers.length = 0;
616
616
  this._isClearing = false;
617
617
  }
618
618