Skip to content

Commit 9e64b03

Browse files
author
Benjamin Pasero
committed
editor picker: open while going through results (fixes microsoft#34324)
1 parent 2f91469 commit 9e64b03

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/vs/workbench/browser/parts/editor/editorPicker.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
1616
import { getIconClasses } from 'vs/workbench/browser/labels';
1717
import { IModelService } from 'vs/editor/common/services/modelService';
1818
import { QuickOpenHandler } from 'vs/workbench/browser/quickopen';
19-
import { Position } from 'vs/platform/editor/common/editor';
19+
import { Position, IEditorOptions } from 'vs/platform/editor/common/editor';
2020
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
2121
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
2222
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -71,15 +71,13 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
7171
}
7272

7373
public run(mode: Mode, context: IEntryRunContext): boolean {
74-
if (mode === Mode.OPEN) {
75-
return this.runOpen(context);
74+
let options: IEditorOptions;
75+
if (mode === Mode.PREVIEW) {
76+
options = { preserveFocus: true }; // in preview, make sure to keep focus in quick open
7677
}
7778

78-
return super.run(mode, context);
79-
}
80-
81-
private runOpen(context: IEntryRunContext): boolean {
82-
this.editorService.openEditor(this.editor, null, this.stacks.positionOfGroup(this.group)).done(null, errors.onUnexpectedError);
79+
// Open Editor
80+
this.editorService.openEditor(this.editor, options, this.stacks.positionOfGroup(this.group)).done(null, errors.onUnexpectedError);
8381

8482
return true;
8583
}

0 commit comments

Comments
 (0)