Skip to content

Commit ba51e22

Browse files
authored
Merge pull request #3429 from obsidian-tasks-group/correct-rename-handler
fix: {{query.file...}} no longer broken when renaming other files (#3335, #3428)
2 parents ea48257 + 28791d7 commit ba51e22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Renderer/QueryRenderer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ class QueryRenderChild extends MarkdownRenderChild {
150150
);
151151

152152
this.registerEvent(
153-
this.app.vault.on('rename', (tFile: TAbstractFile, _oldPath: string) => {
153+
this.app.vault.on('rename', (tFile: TAbstractFile, oldPath: string) => {
154+
if (oldPath !== this.queryResultsRenderer.filePath) {
155+
return;
156+
}
157+
154158
let fileCache: CachedMetadata | null = null;
155159
if (tFile && tFile instanceof TFile) {
156160
fileCache = this.app.metadataCache.getFileCache(tFile);

0 commit comments

Comments
 (0)