@@ -16,7 +16,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
1616import { getIconClasses } from 'vs/workbench/browser/labels' ;
1717import { IModelService } from 'vs/editor/common/services/modelService' ;
1818import { 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' ;
2020import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService' ;
2121import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService' ;
2222import { 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