From 4b8e7a57683a2c39e1b838ed59697850593185c0 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 27 Jul 2022 05:45:56 -0700 Subject: [PATCH] Change default to 0 --- src/browser/Viewport.ts | 6 +++--- src/common/services/OptionsService.ts | 2 +- src/common/services/Services.ts | 2 +- typings/xterm-headless.d.ts | 2 +- typings/xterm.d.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/browser/Viewport.ts b/src/browser/Viewport.ts index c1afabd3..6cff1f98 100644 --- a/src/browser/Viewport.ts +++ b/src/browser/Viewport.ts @@ -198,10 +198,10 @@ export class Viewport extends Disposable implements IViewport { } private _smoothScrollPercent(): number { - if (!this._optionsService.rawOptions.smoothScrollingDuration || !this._smoothScrollState.startTime) { + if (!this._optionsService.rawOptions.smoothScrollDuration || !this._smoothScrollState.startTime) { return 1; } - return Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollingDuration, 1), 0); + return Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollDuration, 1), 0); } private _clearSmoothScrollState(): void { @@ -238,7 +238,7 @@ export class Viewport extends Disposable implements IViewport { if (amount === 0) { return false; } - if (!this._optionsService.rawOptions.smoothScrollingDuration) { + if (!this._optionsService.rawOptions.smoothScrollDuration) { this._viewportElement.scrollTop += amount; } else { this._smoothScrollState.startTime = Date.now(); diff --git a/src/common/services/OptionsService.ts b/src/common/services/OptionsService.ts index 32358bdd..87d04ff9 100644 --- a/src/common/services/OptionsService.ts +++ b/src/common/services/OptionsService.ts @@ -37,7 +37,7 @@ export const DEFAULT_OPTIONS: Readonly = { scrollback: 1000, scrollSensitivity: 1, screenReaderMode: false, - smoothScrollingDuration: 125, + smoothScrollDuration: 0, macOptionIsMeta: false, macOptionClickForcesSelection: false, minimumContrastRatio: 1, diff --git a/src/common/services/Services.ts b/src/common/services/Services.ts index 72418ee2..15cfd8ea 100644 --- a/src/common/services/Services.ts +++ b/src/common/services/Services.ts @@ -241,7 +241,7 @@ export interface ITerminalOptions { screenReaderMode: boolean; scrollback: number; scrollSensitivity: number; - smoothScrollingDuration: number; + smoothScrollDuration: number; tabStopWidth: number; theme: ITheme; windowsMode: boolean; diff --git a/typings/xterm-headless.d.ts b/typings/xterm-headless.d.ts index cc08039e..85433829 100644 --- a/typings/xterm-headless.d.ts +++ b/typings/xterm-headless.d.ts @@ -191,7 +191,7 @@ declare module 'xterm-headless' { * The duration to smoothly scroll between the origin and the target. Set * this to 0 to disable smooth scrolling and scroll instantly. */ - smoothScrollingDuration?: number; + smoothScrollDuration?: number; /** * The size of tab stops in the terminal. diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index afa138d7..1413f66b 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -237,7 +237,7 @@ declare module 'xterm' { * The duration to smoothly scroll between the origin and the target in * milliseconds. Set to 0 to disable smooth scrolling and scroll instantly. */ - smoothScrollingDuration?: number; + smoothScrollDuration?: number; /** * The size of tab stops in the terminal.