Skip to content

Commit 699101e

Browse files
committed
Use Alt to avoid collision with font zooming & other small tweaks
1 parent 986de60 commit 699101e

6 files changed

Lines changed: 13 additions & 21 deletions

File tree

src/vs/base/browser/mouseEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,4 @@ export class StandardWheelEvent {
188188
}
189189
}
190190
}
191-
}
191+
}

src/vs/base/browser/ui/scrollbar/scrollableElement.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,10 @@ export abstract class AbstractScrollableElement extends Widget {
341341
deltaY = 0;
342342
}
343343

344-
if (e.browserEvent.shiftKey !== null) {
345-
//fastScrolling
346-
if (e.browserEvent.shiftKey) {
347-
deltaX = deltaX * this._options.fastScrollSensitivity;
348-
deltaY = deltaY * this._options.fastScrollSensitivity;
349-
}
344+
if (e.browserEvent && e.browserEvent.altKey) {
345+
// fastScrolling
346+
deltaX = deltaX * this._options.fastScrollSensitivity;
347+
deltaY = deltaY * this._options.fastScrollSensitivity;
350348
}
351349

352350
const futureScrollPosition = this._scrollable.getFutureScrollPosition();

src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export interface ScrollableElementCreationOptions {
5151
*/
5252
mouseWheelScrollSensitivity?: number;
5353
/**
54-
* FastScrolling mulitplier speed when pressing `Shift`
55-
* Defaults to 10.
54+
* FastScrolling mulitplier speed when pressing `Alt`
55+
* Defaults to 5.
5656
*/
5757
fastScrollSensitivity?: number;
5858
/**

src/vs/editor/common/config/commonEditorConfig.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,14 +431,8 @@ const editorConfiguration: IConfigurationNode = {
431431
},
432432
'editor.fastScrollSensitivity': {
433433
'type': 'number',
434-
'enum': [1, 5, 10],
435-
enumDescriptions: [
436-
nls.localize('fastScrollSensitivity.1', "Fast Scrolling Off"),
437-
nls.localize('fastScrollSensitivity.5', "Default Speed"),
438-
nls.localize('fastScrollSensitivity.10', "Fast Speed"),
439-
],
440434
'default': EDITOR_DEFAULTS.viewInfo.scrollbar.fastScrollSensitivity,
441-
'markdownDescription': nls.localize('fastScrollSensitivity', "Scrolling speed mulitiplier when pressing `Shift`")
435+
'markdownDescription': nls.localize('fastScrollSensitivity', "Scrolling speed mulitiplier when pressing `Alt`")
442436
},
443437
'editor.multiCursorModifier': {
444438
'type': 'string',

src/vs/editor/common/config/editorOptions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ export interface IEditorOptions {
459459
*/
460460
mouseWheelScrollSensitivity?: number;
461461
/**
462-
* FastScrolling mulitplier speed when pressing `Shift`
463-
* Defaults to 10.
462+
* FastScrolling mulitplier speed when pressing `Alt`
463+
* Defaults to 5.
464464
*/
465465
fastScrollSensitivity?: number;
466466
/**
@@ -1976,7 +1976,7 @@ export class EditorOptionsValidator {
19761976

19771977
let fastScrollSensitivity = _float(opts.fastScrollSensitivity, defaults.scrollbar.fastScrollSensitivity);
19781978
if (fastScrollSensitivity <= 0) {
1979-
fastScrollSensitivity = 5;
1979+
fastScrollSensitivity = defaults.scrollbar.fastScrollSensitivity;
19801980
}
19811981
const scrollbar = this._sanitizeScrollbarOpts(opts.scrollbar, defaults.scrollbar, mouseWheelScrollSensitivity, fastScrollSensitivity);
19821982
const minimap = this._sanitizeMinimapOpts(opts.minimap, defaults.minimap);

src/vs/monaco.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,8 +2788,8 @@ declare namespace monaco.editor {
27882788
*/
27892789
mouseWheelScrollSensitivity?: number;
27902790
/**
2791-
* FastScrolling mulitplier speed when pressing `Shift`
2792-
* Defaults to 10.
2791+
* FastScrolling mulitplier speed when pressing `Alt`
2792+
* Defaults to 5.
27932793
*/
27942794
fastScrollSensitivity?: number;
27952795
/**

0 commit comments

Comments
 (0)