diff --git a/src/vs/workbench/contrib/scm/browser/scmViewPane.ts b/src/vs/workbench/contrib/scm/browser/scmViewPane.ts index a2b1d88cff577..3bd4028c8668f 100644 --- a/src/vs/workbench/contrib/scm/browser/scmViewPane.ts +++ b/src/vs/workbench/contrib/scm/browser/scmViewPane.ts @@ -93,7 +93,7 @@ import { fillEditorsDragData } from 'vs/workbench/browser/dnd'; import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; import { CodeDataTransfers } from 'vs/platform/dnd/browser/dnd'; import { FormatOnType } from 'vs/editor/contrib/format/browser/formatActions'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import { EditorOption, EditorOptions, IRulerOption } from 'vs/editor/common/config/editorOptions'; import { IAsyncDataTreeViewState, ITreeCompressionDelegate } from 'vs/base/browser/ui/tree/asyncDataTree'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { EditOperation } from 'vs/editor/common/core/editOperation'; @@ -2142,7 +2142,8 @@ class SCMInputWidget { overflowWidgetsDomNode, formatOnType: true, renderWhitespace: 'none', - dropIntoEditor: { enabled: true } + dropIntoEditor: { enabled: true }, + ...this.getInputEditorLanguageConfiguration(), }; const codeEditorWidgetOptions: ICodeEditorWidgetOptions = { @@ -2208,7 +2209,9 @@ class SCMInputWidget { 'editor.fontFamily', // When `scm.inputFontFamily` is 'editor', we use it as an effective value 'scm.inputFontSize', 'editor.accessibilitySupport', - 'editor.cursorBlinking' + 'editor.cursorBlinking', + 'editor.rulers', + 'editor.wordWrap' ]; const onRelevantSettingChanged = Event.filter( @@ -2235,7 +2238,8 @@ class SCMInputWidget { fontSize: fontSize, lineHeight: lineHeight, accessibilitySupport, - cursorBlinking + cursorBlinking, + ...this.getInputEditorLanguageConfiguration() }); this.setPlaceholderFontStyles(fontFamily, fontSize, lineHeight); @@ -2412,6 +2416,16 @@ class SCMInputWidget { return this.configurationService.getValue('scm.inputFontSize'); } + private getInputEditorLanguageConfiguration(): { rulers: (number | IRulerOption)[]; wordWrap: 'off' | 'on' | 'wordWrapColumn' | 'bounded' } { + const rulers = this.configurationService.inspect('editor.rulers', { overrideIdentifier: 'scminput' }); + const wordWrap = this.configurationService.inspect('editor.wordWrap', { overrideIdentifier: 'scminput' }); + + return { + rulers: rulers.overrideIdentifiers?.includes('scminput') ? EditorOptions.rulers.validate(rulers.value) : [], + wordWrap: wordWrap.overrideIdentifiers?.includes('scminput') ? EditorOptions.wordWrap.validate(wordWrap) : 'on' + }; + } + private getToolbarWidth(): number { const showInputActionButton = this.configurationService.getValue('scm.showInputActionButton'); if (!this.toolbar || !showInputActionButton || this.toolbar?.isEmpty() === true) {