CaseInsensitiveFileIndex.rename method
CaseInsensitiveFileIndex › rename
Re-keys an abstract file (and, for folders, all of its descendants) after a rename.Obsidian fires a single
rename event for the renamed abstract file and updates its descendants' paths in place without firing per-descendant events, so descendant keys are recomputed here by swapping the old path prefix for the new one. Handles case-only renames (the old and new keys coincide).Signature:
rename(oldPath: string, newAbstractFile: TAbstractFile): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| oldPath | string | The path the abstract file had before the rename. |
| newAbstractFile | TAbstractFile | The abstract file with its updated (post-rename) path. |
Returns: void