diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-12-08 09:21:15 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-12-08 09:21:15 +0100 |
| commit | b33fe9f37d6a9c672650df1c61e897f2582ef563 (patch) | |
| tree | 707ee47470715b46523d02a86d6e4304c0d130bc /vis-lua.c | |
| parent | 6d1d45776b231304b0ff41b5e6098f07931ec44e (diff) | |
| download | vis-b33fe9f37d6a9c672650df1c61e897f2582ef563.tar.gz vis-b33fe9f37d6a9c672650df1c61e897f2582ef563.tar.xz | |
vis-lua: expose init event and use it to set default theme
The init event is emitted immediately after `visrc.lua` has been sourced, but
before any other events have occured, in particular the command line arguments
have not yet been processed.
Close #422
Diffstat (limited to 'vis-lua.c')
| -rw-r--r-- | vis-lua.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1846,6 +1846,15 @@ static bool package_exist(Vis *vis, lua_State *L, const char *name) { return ret; } +/*** + * Editor initialization completed. + * This event is emitted immediately after `visrc.lua` has been sourced, but + * before any other events have occured, in particular the command line arguments + * have not yet been processed. + * + * Can be used to set *global* configuration options. + * @function init + */ void vis_lua_init(Vis *vis) { lua_State *L = luaL_newstate(); if (!L) @@ -1979,6 +1988,7 @@ void vis_lua_init(Vis *vis) { lua_getglobal(L, "require"); lua_pushstring(L, "visrc"); pcall(vis, L, 1, 0); + vis_lua_event_call(vis, "init"); } } @@ -1987,7 +1997,6 @@ void vis_lua_init(Vis *vis) { * This event is emitted immediately before the main loop starts. * At this point all files are loaded and corresponding windows are created. * We are about to process interactive keyboard input. - * Can be used to set *global* configuration options. * @function start */ void vis_lua_start(Vis *vis) { |
