diff --git a/src/main.ts b/src/main.ts index 6b3f691..d119ae2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,10 +11,12 @@ export default class NodeFactor extends Plugin { this.addSettingTab(new NodeFactorSettingTab(this.app, this)); this.registerEvent( - this.app.workspace.on("active-leaf-change", () => { - // we can still use cache when only active leaf changes - this.updateGraph(); - }), + this.app.workspace.on("active-leaf-change", () => + this.updateGraph(), + ), + ); + this.registerEvent( + this.app.workspace.on("layout-change", () => this.updateGraph()), ); // clear cache when there is change in the vault @@ -71,6 +73,14 @@ export default class NodeFactor extends Plugin { const settings = this.settings; let weight = 0; + let manualFileData = settings.manual.find( + (manualFileData) => manualFileData.id == node.id, + ); + if (manualFileData != null) { + console.log(manualFileData); + return manualFileData.weight; + } + weight += Object.keys(node.reverse).length * settings.bwdMultiplier; if (settings.fwdTree) { weight +=