aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 0c043fc..fb560ab 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -13,6 +13,7 @@
#if !CONFIG_LUA
+void vis_lua_init(Vis *vis) { }
void vis_lua_start(Vis *vis) { }
void vis_lua_quit(Vis *vis) { }
void vis_lua_file_open(Vis *vis, File *file) { }
@@ -970,7 +971,7 @@ static bool vis_lua_path_add(Vis *vis, const char *path) {
return true;
}
-void vis_lua_start(Vis *vis) {
+void vis_lua_init(Vis *vis) {
lua_State *L = luaL_newstate();
if (!L)
return;
@@ -1043,6 +1044,12 @@ void vis_lua_start(Vis *vis) {
lua_getglobal(L, "require");
lua_pushstring(L, "visrc");
pcall(vis, L, 1, 0);
+}
+
+void vis_lua_start(Vis *vis) {
+ lua_State *L = vis->lua;
+ if (!L)
+ return;
vis_lua_event(vis, "start");
if (lua_isfunction(L, -1))
pcall(vis, L, 0, 0);