This commit is contained in:
Chris Ewald 2021-11-26 14:20:15 +00:00 committed by GitHub
commit a1b9fff887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 1 deletions

View file

@ -235,6 +235,13 @@ export interface IEditorOptions {
*/
revealIfOpened?: boolean;
/**
* Controls whether editors opened from Quick Open will always open in the currently active editor group.
* Similar to setting the 'revealIfOpened' setting to false, this will open multiple copies of an editor in
* different editor groups.
*/
alwaysOpenInActiveGroupFromQuickOpen?: boolean;
/**
* An editor that is pinned remains in the editor stack even when another editor is being opened.
* An editor that is not pinned will always get replaced by another editor that is not pinned.

View file

@ -179,7 +179,13 @@ export abstract class BaseEditorQuickAccessProvider extends PickerQuickAccessPro
return TriggerAction.NO_ACTION;
},
accept: (keyMods, event) => this.editorGroupService.getGroup(groupId)?.openEditor(editor, { preserveFocus: event.inBackground }),
accept: (keyMods, event) => {
if (this.editorGroupService.partOptions.alwaysOpenInActiveGroupFromQuickOpen) {
this.editorGroupService.activeGroup?.openEditor(editor, { preserveFocus: event.inBackground });
} else {
this.editorGroupService.getGroup(groupId)?.openEditor(editor, { preserveFocus: event.inBackground });
}
},
};
});
}

View file

@ -162,6 +162,11 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
'markdownDescription': localize('enablePreviewFromQuickOpen', "Controls whether editors opened from Quick Open show as preview. Preview editors do not keep open and are reused until explicitly set to be kept open (e.g. via double click or editing). This value is ignored when `#workbench.editor.enablePreview#` is disabled."),
'default': false
},
'workbench.editor.alwaysOpenInActiveGroupFromQuickOpen': {
'type': 'boolean',
'markdownDescription': localize('alwaysOpenInActiveGroupFromQuickOpen', "Controls whether editors opened from Quick Open will always open in the currently active Editor Group."),
'default': false
},
'workbench.editor.enablePreviewFromCodeNavigation': {
'type': 'boolean',
'markdownDescription': localize('enablePreviewFromCodeNavigation', "Controls whether editors remain in preview when a code navigation is started from them. Preview editors do not keep open and are reused until explicitly set to be kept open (e.g. via double click or editing). This value is ignored when `#workbench.editor.enablePreview#` is disabled."),

View file

@ -850,6 +850,7 @@ interface IEditorPartConfiguration {
closeEmptyGroups?: boolean;
autoLockGroups?: Set<string>;
revealIfOpen?: boolean;
alwaysOpenInActiveGroupFromQuickOpen?: boolean;
mouseBackForwardToNavigate?: boolean;
labelFormat?: 'default' | 'short' | 'medium' | 'long';
restoreViewState?: boolean;