mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Update main.ts
This commit is contained in:
parent
0469221b90
commit
ab91d14f67
1 changed files with 1 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
}
|
||||
} else if (file instanceof TFile) {
|
||||
const folder = this.app.vault.getAbstractFileByPath(oldPath.substring(0, oldPath.lastIndexOf('/' || '\\')));
|
||||
if (file.name !== folder?.name + '.md') return;
|
||||
if (folder instanceof TFolder) {
|
||||
this.app.vault.rename(folder, folder.path.substring(0, folder.path.lastIndexOf('/' || '\\')) + '/' + file.name.substring(0, file.name.lastIndexOf('.')));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue