summaryrefslogtreecommitdiff
path: root/src/commands.c
diff options
context:
space:
mode:
authorportix <none@none>2013-01-28 17:49:14 +0100
committerportix <none@none>2013-01-28 17:49:14 +0100
commit422e28fd748f3c2b0e89aa14614a0ac42c1847fb (patch)
tree0df1db793c66aaba55423b1b6fae8d2502d65023 /src/commands.c
parenta76637c331e2fadb7031764f70a8aa9068053e57 (diff)
downloaddwb-422e28fd748f3c2b0e89aa14614a0ac42c1847fb.zip
New signal 'executeCommand'
Diffstat (limited to 'src/commands.c')
-rw-r--r--src/commands.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/commands.c b/src/commands.c
index b8de8ffb..564b2ae3 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -54,6 +54,21 @@ commands_simple_command(KeyMap *km)
completion_clean_autocompletion();
}
+ if (EMIT_SCRIPT(EXECUTE_COMMAND))
+ {
+ char *json = util_create_json(3,
+ CHAR, "command", km->map->n.first,
+ CHAR, "argument", arg->p,
+ INTEGER, "nummod", dwb.state.nummod);
+ ScriptSignal sig = { NULL, SCRIPTS_SIG_META(json, EXECUTE_COMMAND, 0) } ;
+
+ gboolean prevent = scripts_emit(&sig);
+ g_free(json);
+
+ if (prevent)
+ return STATUS_OK;
+ }
+
ret = func(km, arg);
switch (ret)
{