Skip to content

Commit

Permalink
Open tag page before did-create event fires
Browse files Browse the repository at this point in the history
  • Loading branch information
pjeby committed Jun 6, 2023
1 parent 87e0215 commit 840caa5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -170,3 +170,5 @@ For users of Quickadd and other plugins that allow user-defined Javascript, note
### `tag-page:did-create`

This event allows other plugins to modify or rename a newly-created tag page. It has the same callback signature as `tag-page:will-create`, except the `file` field will always contain a TFile. (The one created by Tag Wrangler or by a callback to `tag-page:will-create`.) You should use the `app.vault.process()` method to do any changes, to prevent accidental file overwrites and data loss. (It should also be safe to `app.vault.rename()` it to change its name or location.)

Unlike event handlers for `will-create`, the handler for `did-create` can be asynchronous.
2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -3,7 +3,7 @@
"name": "Tag Wrangler",
"author": "PJ Eby",
"authorUrl": "https://github.com/pjeby",
"version": "0.5.10",
"version": "0.5.11",
"minAppVersion": "0.15.9",
"description": "Rename, merge, toggle, and search tags from the tag pane",
"isDesktopOnly": false
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.js
Expand Up @@ -43,8 +43,8 @@ export default class TagWrangler extends Plugin {
].join("\n"));
}
tp_evt.file = file;
await this.openTagPage(file, true, newLeaf);
app.workspace.trigger("tag-page:did-create", tp_evt);
this.openTagPage(file, true, newLeaf);
}

async onload(){
Expand Down
2 changes: 1 addition & 1 deletion versions.json
@@ -1,5 +1,5 @@
{
"0.5.10": "0.15.9",
"0.5.11": "0.15.9",
"0.5.5": "0.15.9",
"0.5.3": "0.14.5",
"0.5.2": "0.13.19",
Expand Down

0 comments on commit 840caa5

Please sign in to comment.