diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-02-17 21:10:34 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-02-18 16:50:40 +0100 |
| commit | 55e285783ef99befcc01d7ed6f5594f87d6d8f6c (patch) | |
| tree | 59859e0e3e8cbdc91882b38f6df1503cb993b288 /vis-lua.c | |
| parent | b3862a3dca144d44ed27b74ffc04afa306f88a89 (diff) | |
| download | vis-55e285783ef99befcc01d7ed6f5594f87d6d8f6c.tar.gz vis-55e285783ef99befcc01d7ed6f5594f87d6d8f6c.tar.xz | |
vis-lua: expose vis:textobject(id)
Diffstat (limited to 'vis-lua.c')
| -rw-r--r-- | vis-lua.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -397,6 +397,13 @@ err: return 1; } +static int textobject(lua_State *L) { + Vis *vis = obj_ref_check(L, 1, "vis"); + enum VisTextObject id = luaL_checkunsigned(L, 2); + lua_pushboolean(L, vis && vis_textobject(vis, id)); + return 1; +} + static int vis_index(lua_State *L) { Vis *vis = obj_ref_check(L, 1, "vis"); if (!vis) { @@ -461,6 +468,7 @@ static const struct luaL_Reg vis_lua[] = { { "map", map }, { "motion", motion }, { "motion_register", motion_register }, + { "textobject", textobject }, { "__index", vis_index }, { "__newindex", vis_newindex }, { NULL, NULL }, |
