# HG changeset patch # User Ludovic Chabant # Date 1696266253 25200 # Node ID e932f1b731339df6ce7550d0194fa455cc8fdd0a # Parent 1fe2cd2c603f6faf6d563ee1fe0ca0243eaa3156 Pass `this` as the context for various callbacks. diff -r 1fe2cd2c603f -r e932f1b73133 src/main.ts --- a/src/main.ts Mon Oct 02 10:02:54 2023 -0700 +++ b/src/main.ts Mon Oct 02 10:04:13 2023 -0700 @@ -126,10 +126,10 @@ await this.readStateDatabase(STATE_DB_PATH); - this.registerEvent(this.app.workspace.on('file-open', this.onFileOpen)); - this.registerEvent(this.app.workspace.on('quit', this.onAppQuit)); - this.registerEvent(this.app.vault.on('rename', this.onFileRename)); - this.registerEvent(this.app.vault.on('delete', this.onFileDelete)); + this.registerEvent(this.app.workspace.on('file-open', this.onFileOpen, this)); + this.registerEvent(this.app.workspace.on('quit', this.onAppQuit, this)); + this.registerEvent(this.app.vault.on('rename', this.onFileRename, this)); + this.registerEvent(this.app.vault.on('delete', this.onFileDelete, this)); this.app.workspace.onLayoutReady(() => { this.onLayoutReady(); });