Skip to content

Commit ee61306

Browse files
committed
Rename option to scrollPredominantAxis
1 parent bc30f28 commit ee61306

File tree

6 files changed

+76
-73
lines changed

6 files changed

+76
-73
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export abstract class AbstractScrollableElement extends Widget {
287287
this._options.handleMouseWheel = massagedOptions.handleMouseWheel;
288288
this._options.mouseWheelScrollSensitivity = massagedOptions.mouseWheelScrollSensitivity;
289289
this._options.fastScrollSensitivity = massagedOptions.fastScrollSensitivity;
290-
this._options.scrollPredominantAxisOnly = massagedOptions.scrollPredominantAxisOnly;
290+
this._options.scrollPredominantAxis = massagedOptions.scrollPredominantAxis;
291291
this._setListeningToMouseWheel(this._options.handleMouseWheel);
292292

293293
if (!this._options.lazyRender) {
@@ -335,7 +335,7 @@ export abstract class AbstractScrollableElement extends Widget {
335335
let deltaY = e.deltaY * this._options.mouseWheelScrollSensitivity;
336336
let deltaX = e.deltaX * this._options.mouseWheelScrollSensitivity;
337337

338-
if (this._options.scrollPredominantAxisOnly) {
338+
if (this._options.scrollPredominantAxis) {
339339
if (Math.abs(deltaY) >= Math.abs(deltaX)) {
340340
deltaX = 0;
341341
} else {
@@ -562,7 +562,7 @@ function resolveOptions(opts: ScrollableElementCreationOptions): ScrollableEleme
562562
scrollYToX: (typeof opts.scrollYToX !== 'undefined' ? opts.scrollYToX : false),
563563
mouseWheelScrollSensitivity: (typeof opts.mouseWheelScrollSensitivity !== 'undefined' ? opts.mouseWheelScrollSensitivity : 1),
564564
fastScrollSensitivity: (typeof opts.fastScrollSensitivity !== 'undefined' ? opts.fastScrollSensitivity : 5),
565-
scrollPredominantAxisOnly: (typeof opts.scrollPredominantAxisOnly !== 'undefined' ? opts.scrollPredominantAxisOnly : true),
565+
scrollPredominantAxis: (typeof opts.scrollPredominantAxis !== 'undefined' ? opts.scrollPredominantAxis : true),
566566
mouseWheelSmoothScroll: (typeof opts.mouseWheelSmoothScroll !== 'undefined' ? opts.mouseWheelSmoothScroll : true),
567567
arrowSize: (typeof opts.arrowSize !== 'undefined' ? opts.arrowSize : 11),
568568

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ export interface ScrollableElementCreationOptions {
5656
*/
5757
fastScrollSensitivity?: number;
5858
/**
59-
* Whether the editor will only scroll along the predominant axis when scrolling both
59+
* Whether the scrollable will only scroll along the predominant axis when scrolling both
6060
* vertically and horizontally at the same time.
6161
* Prevents horizontal drift when scrolling vertically on a trackpad.
6262
* Defaults to true.
6363
*/
64-
scrollPredominantAxisOnly?: boolean;
64+
scrollPredominantAxis?: boolean;
6565
/**
6666
* Height for vertical arrows (top/bottom) and width for horizontal arrows (left/right).
6767
* Defaults to 11.
@@ -120,7 +120,7 @@ export interface ScrollableElementChangeOptions {
120120
handleMouseWheel?: boolean;
121121
mouseWheelScrollSensitivity?: number;
122122
fastScrollSensitivity: number;
123-
scrollPredominantAxisOnly: boolean;
123+
scrollPredominantAxis: boolean;
124124
}
125125

126126
export interface ScrollableElementResolvedOptions {
@@ -133,7 +133,7 @@ export interface ScrollableElementResolvedOptions {
133133
alwaysConsumeMouseWheel: boolean;
134134
mouseWheelScrollSensitivity: number;
135135
fastScrollSensitivity: number;
136-
scrollPredominantAxisOnly: boolean;
136+
scrollPredominantAxis: boolean;
137137
mouseWheelSmoothScroll: boolean;
138138
arrowSize: number;
139139
listenOnDomNode: HTMLElement | null;

src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class EditorScrollbar extends ViewPart {
3434
const scrollbar = options.get(EditorOption.scrollbar);
3535
const mouseWheelScrollSensitivity = options.get(EditorOption.mouseWheelScrollSensitivity);
3636
const fastScrollSensitivity = options.get(EditorOption.fastScrollSensitivity);
37-
const scrollPredominantAxisOnly = options.get(EditorOption.scrollPredominantAxisOnly);
37+
const scrollPredominantAxis = options.get(EditorOption.scrollPredominantAxis);
3838

3939
const scrollbarOptions: ScrollableElementCreationOptions = {
4040
listenOnDomNode: viewDomNode.domNode,
@@ -55,7 +55,7 @@ export class EditorScrollbar extends ViewPart {
5555
arrowSize: scrollbar.arrowSize,
5656
mouseWheelScrollSensitivity: mouseWheelScrollSensitivity,
5757
fastScrollSensitivity: fastScrollSensitivity,
58-
scrollPredominantAxisOnly: scrollPredominantAxisOnly,
58+
scrollPredominantAxis: scrollPredominantAxis,
5959
};
6060

6161
this.scrollbar = this._register(new SmoothScrollableElement(linesContent.domNode, scrollbarOptions, this._context.viewLayout.getScrollable()));
@@ -142,12 +142,12 @@ export class EditorScrollbar extends ViewPart {
142142
const scrollbar = options.get(EditorOption.scrollbar);
143143
const mouseWheelScrollSensitivity = options.get(EditorOption.mouseWheelScrollSensitivity);
144144
const fastScrollSensitivity = options.get(EditorOption.fastScrollSensitivity);
145-
const scrollPredominantAxisOnly = options.get(EditorOption.scrollPredominantAxisOnly);
145+
const scrollPredominantAxis = options.get(EditorOption.scrollPredominantAxis);
146146
const newOpts: ScrollableElementChangeOptions = {
147147
handleMouseWheel: scrollbar.handleMouseWheel,
148148
mouseWheelScrollSensitivity: mouseWheelScrollSensitivity,
149149
fastScrollSensitivity: fastScrollSensitivity,
150-
scrollPredominantAxisOnly: scrollPredominantAxisOnly
150+
scrollPredominantAxis: scrollPredominantAxis
151151
};
152152
this.scrollbar.updateOptions(newOpts);
153153
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export interface IEditorOptions {
323323
* Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad.
324324
* Defaults to true.
325325
*/
326-
scrollPredominantAxisOnly?: boolean;
326+
scrollPredominantAxis?: boolean;
327327
/**
328328
* The modifier to be used to add multiple cursors with the mouse.
329329
* Defaults to 'alt'
@@ -3198,7 +3198,7 @@ export const enum EditorOption {
31983198
scrollbar,
31993199
scrollBeyondLastColumn,
32003200
scrollBeyondLastLine,
3201-
scrollPredominantAxisOnly,
3201+
scrollPredominantAxis,
32023202
selectionClipboard,
32033203
selectionHighlight,
32043204
selectOnLineNumbers,
@@ -3657,9 +3657,9 @@ export const EditorOptions = {
36573657
EditorOption.scrollBeyondLastLine, 'scrollBeyondLastLine', true,
36583658
{ description: nls.localize('scrollBeyondLastLine', "Controls whether the editor will scroll beyond the last line.") }
36593659
)),
3660-
scrollPredominantAxisOnly: register(new EditorBooleanOption(
3661-
EditorOption.scrollPredominantAxisOnly, 'scrollPredominantAxisOnly', true,
3662-
{ description: nls.localize('scrollPredominantAxisOnly', "Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.") }
3660+
scrollPredominantAxis: register(new EditorBooleanOption(
3661+
EditorOption.scrollPredominantAxis, 'scrollPredominantAxis', true,
3662+
{ description: nls.localize('scrollPredominantAxis', "Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.") }
36633663
)),
36643664
selectionClipboard: register(new EditorBooleanOption(
36653665
EditorOption.selectionClipboard, 'selectionClipboard', true,

src/vs/editor/common/standalone/standaloneEnums.ts

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -247,34 +247,35 @@ export enum EditorOption {
247247
scrollbar = 79,
248248
scrollBeyondLastColumn = 80,
249249
scrollBeyondLastLine = 81,
250-
selectionClipboard = 82,
251-
selectionHighlight = 83,
252-
selectOnLineNumbers = 84,
253-
showFoldingControls = 85,
254-
showUnused = 86,
255-
snippetSuggestions = 87,
256-
smoothScrolling = 88,
257-
stopRenderingLineAfter = 89,
258-
suggest = 90,
259-
suggestFontSize = 91,
260-
suggestLineHeight = 92,
261-
suggestOnTriggerCharacters = 93,
262-
suggestSelection = 94,
263-
tabCompletion = 95,
264-
useTabStops = 96,
265-
wordSeparators = 97,
266-
wordWrap = 98,
267-
wordWrapBreakAfterCharacters = 99,
268-
wordWrapBreakBeforeCharacters = 100,
269-
wordWrapColumn = 101,
270-
wordWrapMinified = 102,
271-
wrappingIndent = 103,
272-
wrappingStrategy = 104,
273-
editorClassName = 105,
274-
pixelRatio = 106,
275-
tabFocusMode = 107,
276-
layoutInfo = 108,
277-
wrappingInfo = 109
250+
scrollPredominantAxis = 82,
251+
selectionClipboard = 83,
252+
selectionHighlight = 84,
253+
selectOnLineNumbers = 85,
254+
showFoldingControls = 86,
255+
showUnused = 87,
256+
snippetSuggestions = 88,
257+
smoothScrolling = 89,
258+
stopRenderingLineAfter = 90,
259+
suggest = 91,
260+
suggestFontSize = 92,
261+
suggestLineHeight = 93,
262+
suggestOnTriggerCharacters = 94,
263+
suggestSelection = 95,
264+
tabCompletion = 96,
265+
useTabStops = 97,
266+
wordSeparators = 98,
267+
wordWrap = 99,
268+
wordWrapBreakAfterCharacters = 100,
269+
wordWrapBreakBeforeCharacters = 101,
270+
wordWrapColumn = 102,
271+
wordWrapMinified = 103,
272+
wrappingIndent = 104,
273+
wrappingStrategy = 105,
274+
editorClassName = 106,
275+
pixelRatio = 107,
276+
tabFocusMode = 108,
277+
layoutInfo = 109,
278+
wrappingInfo = 110
278279
}
279280

280281
/**

src/vs/monaco.d.ts

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,7 @@ declare namespace monaco.editor {
27982798
* Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad.
27992799
* Defaults to true.
28002800
*/
2801-
scrollPredominantAxisOnly?: boolean;
2801+
scrollPredominantAxis?: boolean;
28022802
/**
28032803
* The modifier to be used to add multiple cursors with the mouse.
28042804
* Defaults to 'alt'
@@ -3777,34 +3777,35 @@ declare namespace monaco.editor {
37773777
scrollbar = 79,
37783778
scrollBeyondLastColumn = 80,
37793779
scrollBeyondLastLine = 81,
3780-
selectionClipboard = 82,
3781-
selectionHighlight = 83,
3782-
selectOnLineNumbers = 84,
3783-
showFoldingControls = 85,
3784-
showUnused = 86,
3785-
snippetSuggestions = 87,
3786-
smoothScrolling = 88,
3787-
stopRenderingLineAfter = 89,
3788-
suggest = 90,
3789-
suggestFontSize = 91,
3790-
suggestLineHeight = 92,
3791-
suggestOnTriggerCharacters = 93,
3792-
suggestSelection = 94,
3793-
tabCompletion = 95,
3794-
useTabStops = 96,
3795-
wordSeparators = 97,
3796-
wordWrap = 98,
3797-
wordWrapBreakAfterCharacters = 99,
3798-
wordWrapBreakBeforeCharacters = 100,
3799-
wordWrapColumn = 101,
3800-
wordWrapMinified = 102,
3801-
wrappingIndent = 103,
3802-
wrappingStrategy = 104,
3803-
editorClassName = 105,
3804-
pixelRatio = 106,
3805-
tabFocusMode = 107,
3806-
layoutInfo = 108,
3807-
wrappingInfo = 109
3780+
scrollPredominantAxis = 82,
3781+
selectionClipboard = 83,
3782+
selectionHighlight = 84,
3783+
selectOnLineNumbers = 85,
3784+
showFoldingControls = 86,
3785+
showUnused = 87,
3786+
snippetSuggestions = 88,
3787+
smoothScrolling = 89,
3788+
stopRenderingLineAfter = 90,
3789+
suggest = 91,
3790+
suggestFontSize = 92,
3791+
suggestLineHeight = 93,
3792+
suggestOnTriggerCharacters = 94,
3793+
suggestSelection = 95,
3794+
tabCompletion = 96,
3795+
useTabStops = 97,
3796+
wordSeparators = 98,
3797+
wordWrap = 99,
3798+
wordWrapBreakAfterCharacters = 100,
3799+
wordWrapBreakBeforeCharacters = 101,
3800+
wordWrapColumn = 102,
3801+
wordWrapMinified = 103,
3802+
wrappingIndent = 104,
3803+
wrappingStrategy = 105,
3804+
editorClassName = 106,
3805+
pixelRatio = 107,
3806+
tabFocusMode = 108,
3807+
layoutInfo = 109,
3808+
wrappingInfo = 110
38083809
}
38093810
export const EditorOptions: {
38103811
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
@@ -3889,6 +3890,7 @@ declare namespace monaco.editor {
38893890
scrollbar: IEditorOption<EditorOption.scrollbar, InternalEditorScrollbarOptions>;
38903891
scrollBeyondLastColumn: IEditorOption<EditorOption.scrollBeyondLastColumn, number>;
38913892
scrollBeyondLastLine: IEditorOption<EditorOption.scrollBeyondLastLine, boolean>;
3893+
scrollPredominantAxis: IEditorOption<EditorOption.scrollPredominantAxis, boolean>;
38923894
selectionClipboard: IEditorOption<EditorOption.selectionClipboard, boolean>;
38933895
selectionHighlight: IEditorOption<EditorOption.selectionHighlight, boolean>;
38943896
selectOnLineNumbers: IEditorOption<EditorOption.selectOnLineNumbers, boolean>;

0 commit comments

Comments
 (0)