Skip to content

Commit

Permalink
fix(Codeblock): 🐛 Refresh codeblocks after initialising index
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jan 11, 2022
1 parent d2c0c5d commit c150cb9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ export default class BCPlugin extends Plugin {
if (settings.showBCs) await this.drawTrail();
this.registerActiveLeafChangeEvent();
this.registerLayoutChangeEvent();

this.app.workspace.iterateAllLeaves((leaf) => {
if (leaf instanceof MarkdownView) {
leaf.view.previewMode.rerender(true);
}
});
});

for (const { type, plain, constructor } of this.VIEWS) {
Expand Down Expand Up @@ -600,9 +606,7 @@ export default class BCPlugin extends Plugin {
return;
}

const { dir, fields, type, title, depth, flat } = parsedSource;

switch (type) {
switch (parsedSource.type) {
case "tree":
new CBTree({
target: el,
Expand Down

0 comments on commit c150cb9

Please sign in to comment.