Skip to content

Commit

Permalink
Automatically update TODO when files are changed
Browse files Browse the repository at this point in the history
  • Loading branch information
joeriddles committed Aug 7, 2024
1 parent d99b00a commit 6c3174e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export default class ExtendedTaskListsPlugin extends Plugin {
async onload() {
await this.loadSettings()

// TODO(joeriddles): only re-run updateTodo for changed file(s)
this.registerEvent(this.app.vault.on("create", this.updateTodo))
this.registerEvent(this.app.vault.on("delete", this.updateTodo))
this.registerEvent(this.app.vault.on("modify", this.updateTodo))
this.registerEvent(this.app.vault.on("rename", this.updateTodo))

this.addCommand({
id: 'update-todo',
name: 'Update TODO',
Expand Down

0 comments on commit 6c3174e

Please sign in to comment.