mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 02:26:04 +00:00
fix #51679
This commit is contained in:
parent
8b453ea8d1
commit
c97ccef9cd
|
@ -748,17 +748,20 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
|
|||
openEditorOptions.active = true;
|
||||
}
|
||||
|
||||
// Set group active unless we open inactive or preserve focus
|
||||
// Do this before we open the editor in the group to prevent a false
|
||||
// active editor change event before the editor is loaded
|
||||
// (see https://github.com/Microsoft/vscode/issues/51679)
|
||||
if (openEditorOptions.active && (!options || !options.preserveFocus)) {
|
||||
this.accessor.activateGroup(this);
|
||||
}
|
||||
|
||||
// Update model
|
||||
this._group.openEditor(editor, openEditorOptions);
|
||||
|
||||
// Show editor
|
||||
const showEditorResult = this.doShowEditor(editor, openEditorOptions.active, options);
|
||||
|
||||
// Set group active unless we open inactive or preserve focus
|
||||
if (openEditorOptions.active && (!options || !options.preserveFocus)) {
|
||||
this.accessor.activateGroup(this);
|
||||
}
|
||||
|
||||
return showEditorResult;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue