Skip to content

Commit

Permalink
Defer onDidStyleChange to Repl being visible (#200473)
Browse files Browse the repository at this point in the history
Co-authored-by: Rob Lourens <roblourens@gmail.com>
  • Loading branch information
hsfzxjy and roblourens authored Dec 18, 2023
1 parent 12bb20c commit cd808e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/vs/workbench/contrib/debug/browser/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
private scopedInstantiationService!: IInstantiationService;
private replElementsChangeListener: IDisposable | undefined;
private styleElement: HTMLStyleElement | undefined;
private styleChangedWhenInvisible: boolean = false;
private completionItemProvider: IDisposable | undefined;
private modelChangeListener: IDisposable = Disposable.None;
private filter: ReplFilter;
Expand Down Expand Up @@ -199,6 +200,10 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
this.replInput.setModel(this.model);
this.updateInputDecoration();
this.refreshReplElements(true);
if (this.styleChangedWhenInvisible) {
this.styleChangedWhenInvisible = false;
this.onDidStyleChange();
}
}
}));
this._register(this.configurationService.onDidChangeConfiguration(e => {
Expand Down Expand Up @@ -353,6 +358,10 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
}

private onDidStyleChange(): void {
if (!this.isVisible()) {
this.styleChangedWhenInvisible = true;
return;
}
if (this.styleElement) {
this.replInput.updateOptions({
fontSize: this.replOptions.replConfiguration.fontSize,
Expand Down

0 comments on commit cd808e5

Please sign in to comment.