Skip to content

Commit

Permalink
Fixed vim keybindings not working after reloading wasm plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Oct 26, 2024
1 parent d7cb2c7 commit 54edbaf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions config/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
4 changes: 2 additions & 2 deletions config/settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
3 changes: 3 additions & 0 deletions src/app.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 54edbaf

Please sign in to comment.