delay center layout until editor restore (#155647)

fixes #155564
This commit is contained in:
SteVen Batten 2022-07-19 12:04:19 -07:00 committed by GitHub
parent 8feb40b928
commit 73c0889cb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -245,10 +245,10 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
// Restore editor part on any editor change // Restore editor part on any editor change
this._register(this.editorService.onDidVisibleEditorsChange(showEditorIfHidden)); this._register(this.editorService.onDidVisibleEditorsChange(showEditorIfHidden));
this._register(this.editorGroupService.onDidActivateGroup(showEditorIfHidden)); this._register(this.editorGroupService.onDidActivateGroup(showEditorIfHidden));
});
// Revalidate center layout when active editor changes: diff editor quits centered mode. // Revalidate center layout when active editor changes: diff editor quits centered mode.
this._register(this.editorService.onDidActiveEditorChange(() => this.centerEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED)))); this._register(this.editorService.onDidActiveEditorChange(() => this.centerEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
});
// Configuration changes // Configuration changes
this._register(this.configurationService.onDidChangeConfiguration(() => this.doUpdateLayoutConfiguration())); this._register(this.configurationService.onDidChangeConfiguration(() => this.doUpdateLayoutConfiguration()));
@ -347,7 +347,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
this.updateMenubarVisibility(!!skipLayout); this.updateMenubarVisibility(!!skipLayout);
// Centered Layout // Centered Layout
this.centerEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED), skipLayout); this.editorGroupService.whenRestored.then(() => {
this.centerEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED), skipLayout);
});
} }
private setSideBarPosition(position: Position): void { private setSideBarPosition(position: Position): void {