https://github.com/tadashi-aikawa/obsidian-another-quick-switcher/issues/44 ## New file locationがspecific folder以外の場合にエラーになる phantom fileの場合は問題ない。既に存在するファイルの場合がまずい。 ```ts findFirstLinkOffset(file: TFile, linkFile: TFile): number { // linkFileがphantom const fileCache = this.unsafeApp.metadataCache.getFileCache(file); const links = fileCache?.links ?? []; const embeds = fileCache?.embeds ?? []; // new locationがVault root または current directoryの場合にエラーになる return [...links, ...embeds].find( (x: LinkCache) => this.getPathToBeCreated(x.link) === linkFile.path )!.position.start.offset; } ``` `this.getPathToBeCreated(x.link) === linkFile.path` が `true` にならないのが原因。phantom fileではないときは従来のロジックに戻す。