diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-02-17 14:56:07 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-02-18 16:50:39 +0100 |
| commit | 900d0568099315f42ab004e3a158d23ef7fadd94 (patch) | |
| tree | be33070357b6157d84f205f50b3271496b92482b | |
| parent | 5d9cf02bc9993e076c883f67e3c19bde745540ae (diff) | |
| download | vis-900d0568099315f42ab004e3a158d23ef7fadd94.tar.gz vis-900d0568099315f42ab004e3a158d23ef7fadd94.tar.xz | |
vis-lua: expose vis_motion to lua
| -rw-r--r-- | vis-lua.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -366,6 +366,14 @@ err: return 1; } +static int motion(lua_State *L) { + Vis *vis = obj_ref_check(L, 1, "vis"); + enum VisMotion id = luaL_checkunsigned(L, 2); + // TODO handle var args? + lua_pushboolean(L, vis && vis_motion(vis, id)); + return 1; +} + static int vis_index(lua_State *L) { Vis *vis = obj_ref_check(L, 1, "vis"); if (!vis) { @@ -428,6 +436,7 @@ static const struct luaL_Reg vis_lua[] = { { "info", info }, { "open", open }, { "map", map }, + { "motion", motion }, { "__index", vis_index }, { "__newindex", vis_newindex }, { NULL, NULL }, |
