Skip to content

Commit cd808e5

Browse files
hsfzxjyroblourens
andauthored
Defer onDidStyleChange to Repl being visible (microsoft#200473)
Co-authored-by: Rob Lourens <[email protected]>
1 parent 12bb20c commit cd808e5

File tree

1 file changed

+9
-0
lines changed
  • src/vs/workbench/contrib/debug/browser

1 file changed

+9
-0
lines changed

src/vs/workbench/contrib/debug/browser/repl.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
108108
private scopedInstantiationService!: IInstantiationService;
109109
private replElementsChangeListener: IDisposable | undefined;
110110
private styleElement: HTMLStyleElement | undefined;
111+
private styleChangedWhenInvisible: boolean = false;
111112
private completionItemProvider: IDisposable | undefined;
112113
private modelChangeListener: IDisposable = Disposable.None;
113114
private filter: ReplFilter;
@@ -199,6 +200,10 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
199200
this.replInput.setModel(this.model);
200201
this.updateInputDecoration();
201202
this.refreshReplElements(true);
203+
if (this.styleChangedWhenInvisible) {
204+
this.styleChangedWhenInvisible = false;
205+
this.onDidStyleChange();
206+
}
202207
}
203208
}));
204209
this._register(this.configurationService.onDidChangeConfiguration(e => {
@@ -353,6 +358,10 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
353358
}
354359

355360
private onDidStyleChange(): void {
361+
if (!this.isVisible()) {
362+
this.styleChangedWhenInvisible = true;
363+
return;
364+
}
356365
if (this.styleElement) {
357366
this.replInput.updateOptions({
358367
fontSize: this.replOptions.replConfiguration.fontSize,

0 commit comments

Comments
 (0)