Skip to content

Commit e0a9625

Browse files
committed
microsoft#14102 Fix to retain the state
1 parent de73151 commit e0a9625

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/vs/editor/contrib/folding/browser/folding.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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();

src/vs/workbench/browser/actions/openSettings.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)