diff options
author | bptato <nincsnevem662@gmail.com> | 2024-06-23 13:14:37 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-06-23 13:14:37 +0200 |
commit | 8b517a111d6020f448ff747ac4a2555d2e4160dc (patch) | |
tree | e9d3d7cd082a49f633e32cd2576c18d8384bdc22 /src/local/client.nim | |
parent | 9816f04f7a31c609cf83e7ea1fbf8d33cdb98c4f (diff) | |
download | chawan-8b517a111d6020f448ff747ac4a2555d2e4160dc.tar.gz |
config: fix JS command definitions
Diffstat (limited to 'src/local/client.nim')
-rw-r--r-- | src/local/client.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/local/client.nim b/src/local/client.nim index 24510106..ad4bfaff 100644 --- a/src/local/client.nim +++ b/src/local/client.nim @@ -183,8 +183,9 @@ proc alert(client: Client; msg: string) {.jsfunc.} = client.pager.alert(msg) proc evalActionJS(client: Client; action: string): JSValue = - client.config.cmd.map.withValue(action, p): - return JS_DupValue(client.jsctx, p[]) + if action.startsWith("cmd."): + client.config.cmd.map.withValue(action.substr("cmd.".len), p): + return JS_DupValue(client.jsctx, p[]) return client.evalJS(action, "<command>") # Warning: this is not re-entrant. |