mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
SCM - enable editor option overrides for the scminput language (#201134)
This commit is contained in:
parent
d9b9968d01
commit
811fa13bbb
|
@ -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<number>('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<boolean>('scm.showInputActionButton');
|
||||
if (!this.toolbar || !showInputActionButton || this.toolbar?.isEmpty() === true) {
|
||||
|
|
Loading…
Reference in a new issue