diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index 549a0a40138e3d988326065064e31584e8fc8408..c46a0eeddc29a80dd14de6634020381acb4c58b0 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -230,13 +230,7 @@ export class TextFileEditor extends BaseTextEditor { private openAsFolder(input: EditorInput): boolean { // Since we cannot open a folder, we have to restore the previous input if any and close the editor - let handleEditorPromise: TPromise = this.editorService.closeEditor(this.position, this.input); - let previousInput = this.historyService.getHistory()[1]; - if (previousInput) { - handleEditorPromise = handleEditorPromise.then(() => this.editorService.openEditor(previousInput, null, this.position)); - } - - handleEditorPromise.done(() => { + this.editorService.closeEditor(this.position, this.input).done(() => { // Best we can do is to reveal the folder in the explorer if (input instanceof FileEditorInput) {