Double click a file in explorer causes UI issues (fixes #2713)
This commit is contained in:
parent
e5fedee06b
commit
11e4375706
1 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue