@@ -251,8 +251,8 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView {
251
251
return ! ! this . workspaceMemento [ EditorPart . EDITOR_PART_UI_STATE_STORAGE_KEY ] ;
252
252
}
253
253
254
- private _didRestoreState = false ;
255
- get didRestoreState ( ) : boolean { return this . _didRestoreState ; }
254
+ private _willRestoreState = false ;
255
+ get willRestoreState ( ) : boolean { return this . _willRestoreState ; }
256
256
257
257
getGroups ( order = GroupsOrder . CREATION_TIME ) : IEditorGroupView [ ] {
258
258
switch ( order ) {
@@ -986,7 +986,8 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView {
986
986
) ) ;
987
987
988
988
// Grid control
989
- this . doCreateGridControl ( options ) ;
989
+ this . _willRestoreState = ! options || options . restorePreviousState ;
990
+ this . doCreateGridControl ( ) ;
990
991
991
992
// Centered layout widget
992
993
this . centeredLayoutWidget = this . _register ( new CenteredViewLayout ( this . container , this . gridWidgetView , this . profileMemento [ EditorPart . EDITOR_PART_CENTERED_VIEW_STORAGE_KEY ] , this . _partOptions . centeredLayoutFixedWidth ) ) ;
@@ -1145,11 +1146,11 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView {
1145
1146
return false ;
1146
1147
}
1147
1148
1148
- private doCreateGridControl ( options ?: IEditorPartCreationOptions ) : void {
1149
+ private doCreateGridControl ( ) : void {
1149
1150
1150
1151
// Grid Widget (with previous UI state)
1151
1152
let restoreError = false ;
1152
- if ( ! options || options . restorePreviousState ) {
1153
+ if ( this . _willRestoreState ) {
1153
1154
restoreError = ! this . doCreateGridControlWithPreviousState ( ) ;
1154
1155
}
1155
1156
@@ -1179,9 +1180,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView {
1179
1180
1180
1181
// Grid Widget
1181
1182
this . doCreateGridControlWithState ( uiState . serializedGrid , uiState . activeGroup ) ;
1182
-
1183
- // Remember that we did restore previous state
1184
- this . _didRestoreState = true ;
1185
1183
} catch ( error ) {
1186
1184
1187
1185
// Log error
0 commit comments