File tree Expand file tree Collapse file tree
editor/contrib/folding/browser
workbench/browser/actions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,9 +109,10 @@ export class FoldingController implements IFoldingController {
109109 return ;
110110 }
111111
112- // Clean the state before restoring
112+ // State should be applied on the clean state
113+ // Clean the state
113114 this . cleanState ( ) ;
114- // restore
115+ // apply state
115116 this . applyRegions ( < IFoldingRange [ ] > state . collapsedRegions ) ;
116117 // Start listening to the model
117118 this . onModelChanged ( ) ;
Original file line number Diff line number Diff line change @@ -321,7 +321,11 @@ export class DefaultSettingsEditor extends StringEditor {
321321 }
322322
323323 private saveState ( ) {
324- DefaultSettingsEditor . VIEW_STATE . set ( this . getResource ( ) , this . getControl ( ) . saveViewState ( ) ) ;
324+ const resource = this . getResource ( ) ;
325+ if ( DefaultSettingsEditor . VIEW_STATE . has ( resource ) ) {
326+ DefaultSettingsEditor . VIEW_STATE . delete ( resource ) ;
327+ }
328+ DefaultSettingsEditor . VIEW_STATE . set ( resource , this . getControl ( ) . saveViewState ( ) ) ;
325329 }
326330
327331 private getResource ( ) : URI {
You can’t perform that action at this time.
0 commit comments