changeset 12:42396b88c64d

Don't unnecessarily capture the view reference in injected callbacks
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 28 Feb 2022 22:11:17 -0800
parents 6f7f35af6335
children 7da0dec2dc8d
files src/main.ts
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.ts	Mon Feb 28 22:10:14 2022 -0800
+++ b/src/main.ts	Mon Feb 28 22:11:17 2022 -0800
@@ -138,7 +138,7 @@
 		var uninstall = around(view, {
 			onUnloadFile: function(next) {
 				return async function (unloaded: TFile) {
-					_this.rememberFileState(unloaded, view);
+					_this.rememberFileState(unloaded, this);
 					return await next.call(this, unloaded);
 				};
 			}