From 11e4375706809b59daee7562d0d1521f85fec52e Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 4 Feb 2016 16:27:54 +0100 Subject: [PATCH] Double click a file in explorer causes UI issues (fixes #2713) --- src/vs/workbench/browser/parts/editor/editorPart.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index f4316a06125..17a89988dc1 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -669,6 +669,19 @@ export class EditorPart extends Part implements IEditorPart { if (this.visibleInputs[position] !== input) { timerEvent.stop(); + // It can happen that the same editor input is being opened rapidly one after the other + // (e.g. fast double click on a file). In this case the first open will stop here because + // we detect that a second open happens. However, since the input is the same, inputChanged + // is false and we are not doing some things that we typically do when opening a file because + // we think, the input has not changed. + // The fix is to detect if the active input matches with this one that gets canceled and only + // in that case notify others about the input change event as well as to make sure that the + // editor title area is up to date. + if (this.visibleInputs[position] && this.visibleInputs[position].matches(input)) { + this.updateEditorTitleArea(); + this.emit(WorkbenchEventType.EDITOR_INPUT_CHANGED, new EditorEvent(editor, editor.getId(), this.visibleInputs[position], options, position)); + } + return editor; }