From dd9d91c310f2b21daec83e719996ee0e56f725bc Mon Sep 17 00:00:00 2001 From: manavortex Date: Mon, 27 Nov 2023 22:01:16 +0100 Subject: [PATCH] fixed an exception for workspot files --- Scripts/hook_global.wscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/hook_global.wscript b/Scripts/hook_global.wscript index 7ec9b27..c27a994 100644 --- a/Scripts/hook_global.wscript +++ b/Scripts/hook_global.wscript @@ -89,10 +89,11 @@ globalThis.onSave = function (ext, file) { // either we have nothing to write or we aren't supposed to write => abort if (!FileValidation.isDataChangedForWriting || Settings.DisableAutofix) return retSuccess; + const filePath = wkit.GetActiveDocument().FilePath; + // unless it's a workspot, automatically close and re-open it if (!fileName.endsWith('workspot') || Settings.Workspot.autoReopenFile) { try { - const filePath = wkit.GetActiveDocument().FilePath; Logger.Info(`Filevalidation: Reopening ${filePath} for you…`); wkit.GetActiveDocument().Close(); wkit.OpenDocument(filePath);