Skip to content

Commit 811fa13

Browse files
authored
SCM - enable editor option overrides for the scminput language (microsoft#201134)
1 parent d9b9968 commit 811fa13

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/vs/workbench/contrib/scm/browser/scmViewPane.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ import { fillEditorsDragData } from 'vs/workbench/browser/dnd';
9393
import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView';
9494
import { CodeDataTransfers } from 'vs/platform/dnd/browser/dnd';
9595
import { FormatOnType } from 'vs/editor/contrib/format/browser/formatActions';
96-
import { EditorOption } from 'vs/editor/common/config/editorOptions';
96+
import { EditorOption, EditorOptions, IRulerOption } from 'vs/editor/common/config/editorOptions';
9797
import { IAsyncDataTreeViewState, ITreeCompressionDelegate } from 'vs/base/browser/ui/tree/asyncDataTree';
9898
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
9999
import { EditOperation } from 'vs/editor/common/core/editOperation';
@@ -2142,7 +2142,8 @@ class SCMInputWidget {
21422142
overflowWidgetsDomNode,
21432143
formatOnType: true,
21442144
renderWhitespace: 'none',
2145-
dropIntoEditor: { enabled: true }
2145+
dropIntoEditor: { enabled: true },
2146+
...this.getInputEditorLanguageConfiguration(),
21462147
};
21472148

21482149
const codeEditorWidgetOptions: ICodeEditorWidgetOptions = {
@@ -2208,7 +2209,9 @@ class SCMInputWidget {
22082209
'editor.fontFamily', // When `scm.inputFontFamily` is 'editor', we use it as an effective value
22092210
'scm.inputFontSize',
22102211
'editor.accessibilitySupport',
2211-
'editor.cursorBlinking'
2212+
'editor.cursorBlinking',
2213+
'editor.rulers',
2214+
'editor.wordWrap'
22122215
];
22132216

22142217
const onRelevantSettingChanged = Event.filter(
@@ -2235,7 +2238,8 @@ class SCMInputWidget {
22352238
fontSize: fontSize,
22362239
lineHeight: lineHeight,
22372240
accessibilitySupport,
2238-
cursorBlinking
2241+
cursorBlinking,
2242+
...this.getInputEditorLanguageConfiguration()
22392243
});
22402244

22412245
this.setPlaceholderFontStyles(fontFamily, fontSize, lineHeight);
@@ -2412,6 +2416,16 @@ class SCMInputWidget {
24122416
return this.configurationService.getValue<number>('scm.inputFontSize');
24132417
}
24142418

2419+
private getInputEditorLanguageConfiguration(): { rulers: (number | IRulerOption)[]; wordWrap: 'off' | 'on' | 'wordWrapColumn' | 'bounded' } {
2420+
const rulers = this.configurationService.inspect('editor.rulers', { overrideIdentifier: 'scminput' });
2421+
const wordWrap = this.configurationService.inspect('editor.wordWrap', { overrideIdentifier: 'scminput' });
2422+
2423+
return {
2424+
rulers: rulers.overrideIdentifiers?.includes('scminput') ? EditorOptions.rulers.validate(rulers.value) : [],
2425+
wordWrap: wordWrap.overrideIdentifiers?.includes('scminput') ? EditorOptions.wordWrap.validate(wordWrap) : 'on'
2426+
};
2427+
}
2428+
24152429
private getToolbarWidth(): number {
24162430
const showInputActionButton = this.configurationService.getValue<boolean>('scm.showInputActionButton');
24172431
if (!this.toolbar || !showInputActionButton || this.toolbar?.isEmpty() === true) {

0 commit comments

Comments
 (0)