Skip to content

Commit 5aee2f0

Browse files
committed
Re-render extension editor readme when theme changes
1 parent ea01b39 commit 5aee2f0

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/vs/workbench/contrib/extensions/browser/extensionEditor.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,19 @@ export class ExtensionEditor extends BaseEditor {
593593
webviewElement.layoutWebviewOverElement(template.content);
594594
}
595595
});
596-
597596
this.contentDisposables.add(toDisposable(removeLayoutParticipant));
598597

598+
let isDisposed = false;
599+
this.contentDisposables.add(toDisposable(() => { isDisposed = true; }));
600+
601+
this.contentDisposables.add(this.themeService.onThemeChange(async () => {
602+
// Render again since syntax highlighting of code blocks may have changed
603+
const body = await this.renderMarkdown(cacheResult, template);
604+
if (!isDisposed) { // Make sure we weren't disposed of in the meantime
605+
webviewElement.html = body;
606+
}
607+
}));
608+
599609
this.contentDisposables.add(webviewElement.onDidClickLink(link => {
600610
if (!link) {
601611
return;

0 commit comments

Comments
 (0)