Skip to content

Commit

Permalink
refactored into super
Browse files Browse the repository at this point in the history
  • Loading branch information
wprater committed Oct 25, 2016
1 parent 4fedc38 commit 09bebf0
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ import { IResourceInput, IEditorInput } from 'vs/platform/editor/common/editor';
import { IModeService } from 'vs/editor/common/services/modeService';
import { getIconClasses } from 'vs/workbench/browser/labels';
import { IModelService } from 'vs/editor/common/services/modelService';
import { EditorInput, getUntitledOrFileResource, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor';
// import { EditorInput, getUntitledOrFileResource, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor';
import { EditorInput, getUntitledOrFileResource } from 'vs/workbench/common/editor';
import { WorkbenchComponent } from 'vs/workbench/common/component';
import Event, { Emitter } from 'vs/base/common/event';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { KeyMod } from 'vs/base/common/keyCodes';
// import { KeyMod } from 'vs/base/common/keyCodes';
import { QuickOpenHandler, QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions, EditorQuickOpenEntry } from 'vs/workbench/browser/quickopen';
import errors = require('vs/base/common/errors');
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
Expand Down Expand Up @@ -1144,22 +1145,6 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
}

public run(mode: Mode, context: IEntryRunContext): boolean {
if (mode === Mode.OPEN) {
const sideBySide = !context.quickNavigateConfiguration && context.keymods.indexOf(KeyMod.CtrlCmd) >= 0;
const pinned = !this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>().workbench.editor.enablePreviewFromQuickOpen;

if (this.input instanceof EditorInput) {
this.editorService.openEditor(this.input, { pinned }, sideBySide).done(null, errors.onUnexpectedError);
} else {
this.editorService.openEditor({ resource: (this.input as IResourceInput).resource, options: { pinned } }, sideBySide);
}

return true;
}
else if (mode === Mode.PREVIEW) {
return super.run(mode, context);
}

return super.run(mode, context);
}
}
Expand Down

0 comments on commit 09bebf0

Please sign in to comment.