Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/vs/platform/editor/common/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 7 additions & 1 deletion src/vs/workbench/browser/parts/editor/editorQuickAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
},
};
});
}
Expand Down
5 changes: 5 additions & 0 deletions src/vs/workbench/browser/workbench.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/common/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ interface IEditorPartConfiguration {
closeEmptyGroups?: boolean;
autoLockGroups?: Set<string>;
revealIfOpen?: boolean;
alwaysOpenInActiveGroupFromQuickOpen?: boolean;
mouseBackForwardToNavigate?: boolean;
labelFormat?: 'default' | 'short' | 'medium' | 'long';
restoreViewState?: boolean;
Expand Down