提交 eafa0add 编写于 作者: B Benjamin Pasero

fix #59752

上级 d8c58630
...@@ -865,6 +865,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor ...@@ -865,6 +865,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
} }
// Create new // Create new
const groupViews: IEditorGroupView[] = [];
const gridWidget = SerializableGrid.deserialize(serializedGrid, { const gridWidget = SerializableGrid.deserialize(serializedGrid, {
fromJSON: (serializedEditorGroup: ISerializedEditorGroup) => { fromJSON: (serializedEditorGroup: ISerializedEditorGroup) => {
let groupView: IEditorGroupView; let groupView: IEditorGroupView;
...@@ -874,6 +875,8 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor ...@@ -874,6 +875,8 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
groupView = this.doCreateGroupView(serializedEditorGroup); groupView = this.doCreateGroupView(serializedEditorGroup);
} }
groupViews.push(groupView);
if (groupView.id === activeGroupId) { if (groupView.id === activeGroupId) {
this.doSetGroupActive(groupView); this.doSetGroupActive(groupView);
} }
...@@ -882,6 +885,18 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor ...@@ -882,6 +885,18 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
} }
}, { styles: { separatorBorder: this.gridSeparatorBorder } }); }, { styles: { separatorBorder: this.gridSeparatorBorder } });
// If the active group was not found when restoring the grid
// make sure to make at least one group active. We always need
// an active group.
if (!this._activeGroup) {
this.doSetGroupActive(groupViews[0]);
}
// Validate MRU group views matches grid widget state
if (this.mostRecentActiveGroups.some(groupId => !this.getGroup(groupId))) {
this.mostRecentActiveGroups = groupViews.map(group => group.id);
}
// Set it // Set it
this.doSetGridWidget(gridWidget); this.doSetGridWidget(gridWidget);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册