@xterm/xterm 6.1.0-beta.197 → 6.1.0-beta.198

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.197",
4
+ "version": "6.1.0-beta.198",
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.2.3",
120
120
  "xterm-benchmark": "^0.3.1"
121
121
  },
122
- "commit": "34e017935581b6e0081b0e2bebe53e3193b85be7"
122
+ "commit": "62ce318a075838c05db9ff9a3e4db33f3f1515ca"
123
123
  }
@@ -94,6 +94,12 @@ export class OverviewRulerRenderer extends Disposable {
94
94
  this._register(this._coreBrowserService.onDprChange(() => this._queueRefresh(true)));
95
95
  this._register(this._optionsService.onSpecificOptionChange('scrollbar', () => this._queueRefresh(true)));
96
96
  this._register(this._themeService.onChangeColors(() => this._queueRefresh()));
97
+ this._register(toDisposable(() => {
98
+ if (this._animationFrame !== undefined) {
99
+ this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame);
100
+ this._animationFrame = undefined;
101
+ }
102
+ }));
97
103
  this._queueRefresh(true);
98
104
  }
99
105
 
@@ -136,6 +142,9 @@ export class OverviewRulerRenderer extends Disposable {
136
142
  }
137
143
 
138
144
  private _refreshCanvasDimensions(): void {
145
+ if (this._store.isDisposed || !this._renderService.hasRenderer()) {
146
+ return;
147
+ }
139
148
  const cssCanvasHeight = this._renderService.dimensions.css.canvas.height;
140
149
  const deviceCanvasHeight = this._renderService.dimensions.device.canvas.height;
141
150
  this._canvas.style.width = `${this._width}px`;
@@ -147,6 +156,9 @@ export class OverviewRulerRenderer extends Disposable {
147
156
  }
148
157
 
149
158
  private _refreshDecorations(): void {
159
+ if (this._store.isDisposed || !this._renderService.hasRenderer()) {
160
+ return;
161
+ }
150
162
  if (this._shouldUpdateDimensions) {
151
163
  this._refreshCanvasDimensions();
152
164
  }
@@ -200,13 +212,18 @@ export class OverviewRulerRenderer extends Disposable {
200
212
  }
201
213
 
202
214
  private _queueRefresh(updateCanvasDimensions?: boolean, updateAnchor?: boolean): void {
215
+ if (this._store.isDisposed) {
216
+ return;
217
+ }
203
218
  this._shouldUpdateDimensions = updateCanvasDimensions || this._shouldUpdateDimensions;
204
219
  this._shouldUpdateAnchor = updateAnchor || this._shouldUpdateAnchor;
205
220
  if (this._animationFrame !== undefined) {
206
221
  return;
207
222
  }
208
223
  this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
209
- this._refreshDecorations();
224
+ if (!this._store.isDisposed) {
225
+ this._refreshDecorations();
226
+ }
210
227
  this._animationFrame = undefined;
211
228
  });
212
229
  }
@@ -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.197';
9
+ export const XTERM_VERSION = '6.1.0-beta.198';