diff options
author | SteVen Batten <6561887+sbatten@users.noreply.github.com> | 2022-07-19 22:04:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-19 22:04:19 +0300 |
commit | 73c0889cb7e134f7753d796238b14ec46c7e0e1e (patch) | |
tree | 029e27ffd38541e44ae9f6296df84ebbbd40a9ac /src | |
parent | 8feb40b9284c339e2d1b0a493641e603b7f84d3d (diff) |
delay center layout until editor restore (#155647)
fixes #155564
Diffstat (limited to 'src')
-rw-r--r-- | src/vs/workbench/browser/layout.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 2e997f59f0b..9151c945a6c 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -245,10 +245,10 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // Restore editor part on any editor change this._register(this.editorService.onDidVisibleEditorsChange(showEditorIfHidden)); this._register(this.editorGroupService.onDidActivateGroup(showEditorIfHidden)); - }); - // 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)))); + // 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)))); + }); // Configuration changes this._register(this.configurationService.onDidChangeConfiguration(() => this.doUpdateLayoutConfiguration())); @@ -347,7 +347,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi this.updateMenubarVisibility(!!skipLayout); // 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 { |