aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-12-08 09:06:01 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-12-08 09:11:59 +0100
commit6d1d45776b231304b0ff41b5e6098f07931ec44e (patch)
tree2f7f41170491200d5da92bf4cd570a3e268fbed2 /vis-lua.c
parent065a804d282ac99dd93e9ebaf7bc986ccf53e75b (diff)
downloadvis-6d1d45776b231304b0ff41b5e6098f07931ec44e.tar.gz
vis-6d1d45776b231304b0ff41b5e6098f07931ec44e.tar.xz
lua: add simple event multiplexing mechanism
The editor core calls into the functions registered in the `vis.events` table which then multiplex the events to all registered event handlers. The first handler which returns a non `nil` value terminates event propagation.
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/vis-lua.c b/vis-lua.c
index f3b0114..29f3103 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -1733,13 +1733,14 @@ static const struct luaL_Reg file_lines_funcs[] = {
*/
/***
- * Events.
+ * Core Events.
*
* These events are invoked from the editor core.
- * The following functions are looked up in the `vis.events` table.
- * Keep in mind that the editor is blocked while the event handlers
- * are being executed, avoid long running tasks.
- * @section Events
+ * The following functions are invoked if they are registered in the
+ * `vis.events` table. Users scripts should generally use the [Events](#events)
+ * mechanism instead which multiplexes these core events.
+ *
+ * @section Core Events
*/
static void vis_lua_event_get(lua_State *L, const char *name) {