Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc56983b

Browse files
committed
add setting
1 parentc14ae6e commitc56983b

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ export interface IEditorOptions {
291291
* Defaults to true.
292292
*/
293293
scrollBeyondLastLine?:boolean;
294+
/**
295+
* Scroll editor on middle click
296+
*/
297+
scrollOnMiddleClick?:boolean;
294298
/**
295299
* Enable that scrolling can go beyond the last column by a number of columns.
296300
* Defaults to 5.
@@ -5603,7 +5607,8 @@ export const enum EditorOption {
56035607
defaultColorDecorators,
56045608
colorDecoratorsActivatedOn,
56055609
inlineCompletionsAccessibilityVerbose,
5606-
effectiveExperimentalEditContextEnabled
5610+
effectiveExperimentalEditContextEnabled,
5611+
scrollOnMiddleClick,
56075612
}
56085613

56095614
exportconstEditorOptions={
@@ -6196,6 +6201,10 @@ export const EditorOptions = {
61966201
EditorOption.scrollBeyondLastLine,'scrollBeyondLastLine',true,
61976202
{description:nls.localize('scrollBeyondLastLine',"Controls whether the editor will scroll beyond the last line.")}
61986203
)),
6204+
scrollOnMiddleClick:register(newEditorBooleanOption(
6205+
EditorOption.scrollOnMiddleClick,'scrollOnMiddleClick',false,
6206+
{description:nls.localize('scrollOnMiddleClick',"Controls whether the editor will scroll when the middle button is pressed.")}
6207+
)),
61996208
scrollPredominantAxis:register(newEditorBooleanOption(
62006209
EditorOption.scrollPredominantAxis,'scrollPredominantAxis',true,
62016210
{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.")}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ export enum EditorOption {
329329
defaultColorDecorators=153,
330330
colorDecoratorsActivatedOn=154,
331331
inlineCompletionsAccessibilityVerbose=155,
332-
effectiveExperimentalEditContextEnabled=156
332+
effectiveExperimentalEditContextEnabled=156,
333+
scrollOnMiddleClick=157
333334
}
334335

335336
/**

‎src/vs/editor/contrib/middleScroll/browser/middleScroll.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { IMouseEvent } from '../../../../base/browser/mouseEvent.js';
99
import{ICodeEditor,IEditorMouseEvent}from'../../../browser/editorBrowser.js';
1010
import{EditorContributionInstantiation,registerEditorContribution}from'../../../browser/editorExtensions.js';
1111
import{IEditorContribution}from'../../../common/editorCommon.js';
12+
import{EditorOption}from'../../../common/config/editorOptions.js';
1213

1314
import'./middleScroll.css';
1415

@@ -140,6 +141,10 @@ export class MiddleScrollController extends Disposable implements IEditorContrib
140141
}
141142

142143
windowMouseDown(e:IMouseEvent){
144+
if(!this._editor.getOptions().get(EditorOption.scrollOnMiddleClick)){
145+
return;
146+
}
147+
143148
if(this.scrolling){
144149
if(e.middleButton){
145150
e.stopPropagation();

‎src/vs/monaco.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3341,6 +3341,10 @@ declare namespace monaco.editor {
33413341
* Defaults to true.
33423342
*/
33433343
scrollBeyondLastLine?:boolean;
3344+
/**
3345+
* Scroll editor on middle click
3346+
*/
3347+
scrollOnMiddleClick?:boolean;
33443348
/**
33453349
* Enable that scrolling can go beyond the last column by a number of columns.
33463350
* Defaults to 5.
@@ -5049,7 +5053,8 @@ declare namespace monaco.editor {
50495053
defaultColorDecorators=153,
50505054
colorDecoratorsActivatedOn=154,
50515055
inlineCompletionsAccessibilityVerbose=155,
5052-
effectiveExperimentalEditContextEnabled=156
5056+
effectiveExperimentalEditContextEnabled=156,
5057+
scrollOnMiddleClick=157
50535058
}
50545059

50555060
exportconstEditorOptions:{
@@ -5166,6 +5171,7 @@ declare namespace monaco.editor {
51665171
scrollbar:IEditorOption<EditorOption.scrollbar,InternalEditorScrollbarOptions>;
51675172
scrollBeyondLastColumn:IEditorOption<EditorOption.scrollBeyondLastColumn,number>;
51685173
scrollBeyondLastLine:IEditorOption<EditorOption.scrollBeyondLastLine,boolean>;
5174+
scrollOnMiddleClick:IEditorOption<EditorOption.scrollOnMiddleClick,boolean>;
51695175
scrollPredominantAxis:IEditorOption<EditorOption.scrollPredominantAxis,boolean>;
51705176
selectionClipboard:IEditorOption<EditorOption.selectionClipboard,boolean>;
51715177
selectionHighlight:IEditorOption<EditorOption.selectionHighlight,boolean>;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp