@xterm/xterm 5.6.0-beta.2 → 5.6.0-beta.4
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/package.json +1 -1
- package/src/browser/Viewport.ts +8 -1
package/package.json
CHANGED
package/src/browser/Viewport.ts
CHANGED
|
@@ -36,6 +36,8 @@ export class Viewport extends Disposable implements IViewport {
|
|
|
36
36
|
private _activeBuffer: IBuffer;
|
|
37
37
|
private _renderDimensions: IRenderDimensions;
|
|
38
38
|
|
|
39
|
+
private _smoothScrollAnimationFrame: number = 0;
|
|
40
|
+
|
|
39
41
|
// Stores a partial line amount when scrolling, this is used to keep track of how much of a line
|
|
40
42
|
// is scrolled so we can "scroll" over partial lines and feel natural on touchpads. This is a
|
|
41
43
|
// quick fix and could have a more robust solution in place that reset the value when needed.
|
|
@@ -211,7 +213,12 @@ export class Viewport extends Disposable implements IViewport {
|
|
|
211
213
|
|
|
212
214
|
// Continue or finish smooth scroll
|
|
213
215
|
if (percent < 1) {
|
|
214
|
-
this.
|
|
216
|
+
if (!this._smoothScrollAnimationFrame) {
|
|
217
|
+
this._smoothScrollAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
|
|
218
|
+
this._smoothScrollAnimationFrame = 0;
|
|
219
|
+
this._smoothScroll();
|
|
220
|
+
});
|
|
221
|
+
}
|
|
215
222
|
} else {
|
|
216
223
|
this._clearSmoothScrollState();
|
|
217
224
|
}
|