From 6d1d45776b231304b0ff41b5e6098f07931ec44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 8 Dec 2016 09:06:01 +0100 Subject: 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. --- vis-lua.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'vis-lua.c') 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) { -- cgit v1.2.3