Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address feedback for reset editor.lineNumbers after disabling zen mode #90910

Merged
merged 1 commit into from Feb 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/vs/workbench/browser/layout.ts
Expand Up @@ -122,8 +122,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi

private workbenchGrid!: SerializableGrid<ISerializableView>;

private editorWidgetSet = new Set<IEditor>();

private disposed: boolean | undefined;

private titleBarPartView!: ISerializableView;
Expand Down Expand Up @@ -198,7 +196,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
wasSideBarVisible: false,
wasPanelVisible: false,
transitionDisposables: new DisposableStore(),
setNotificationsFilter: false
setNotificationsFilter: false,
editorWidgetSet: new Set<IEditor>()
},

};
Expand Down Expand Up @@ -708,15 +707,21 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
editor.updateOptions({ lineNumbers });
};

const editorWidgetSet = this.state.zenMode.editorWidgetSet;
if (!lineNumbers) {
// Reset line numbers on all editors visible and non-visible
for (const editor of this.editorWidgetSet) {
for (const editor of editorWidgetSet) {
setEditorLineNumbers(editor);
}
this.editorWidgetSet.clear();
editorWidgetSet.clear();
} else {
this.editorService.visibleTextEditorWidgets.forEach(editor => {
this.editorWidgetSet.add(editor);
if (!editorWidgetSet.has(editor)) {
editorWidgetSet.add(editor);
this.state.zenMode.transitionDisposables.add(editor.onDidDispose(() => {
editorWidgetSet.delete(editor);
}));
}
setEditorLineNumbers(editor);
});
}
Expand Down