From 54edbaf50ee86d942693d06239fed934e881378a Mon Sep 17 00:00:00 2001 From: Nimaoth Date: Sat, 26 Oct 2024 20:37:08 +0200 Subject: [PATCH] Fixed vim keybindings not working after reloading wasm plugins --- config/settings.json | 4 ++++ config/settings.schema.json | 4 ++-- src/app.nim | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/settings.json b/config/settings.json index 9e7ae16f..85f4909f 100644 --- a/config/settings.json +++ b/config/settings.json @@ -514,5 +514,9 @@ "wasm-plugin-post-load-commands": [ "load-theme \"tokyo-night-color-theme\"", "load-configured-keybindings" + ], + + "wasm-plugin-post-reload-commands": [ + "load-configured-keybindings" ] } \ No newline at end of file diff --git a/config/settings.schema.json b/config/settings.schema.json index 66b9ef3b..7a5d4bb7 100644 --- a/config/settings.schema.json +++ b/config/settings.schema.json @@ -300,9 +300,9 @@ } }, - "^\\+?nims-plugin-post-load-commands$": { + "^\\+?wasm-plugin-post-reload-commands$": { "type": "array", - "description": "Array of commands which are executed after loading nimscript plugins", + "description": "Array of commands which are executed after reloading wasm plugins", "items": { "type": "string" } diff --git a/src/app.nim b/src/app.nim index 21a4ce1c..fa5f6440 100644 --- a/src/app.nim +++ b/src/app.nim @@ -2058,6 +2058,9 @@ proc reloadPluginAsync*(self: App) {.async.} = except CatchableError: log lvlError, &"Failed to reload wasm plugins: {getCurrentExceptionMsg()}\n{getCurrentException().getStackTrace()}" + self.runConfigCommands("wasm-plugin-post-reload-commands") + self.runConfigCommands("plugin-post-reload-commands") + proc reloadConfigAsync*(self: App) {.async.} = await self.loadConfigFrom(appConfigDir) await self.loadConfigFrom(homeConfigDir)