From dddf34dac6d462d536c33e5bcc63fd61b106066d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 23 Feb 2017 07:43:52 +0100 Subject: vis-lua: make vis:count assignable --- vis-lua.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vis-lua.c b/vis-lua.c index 1cb8c16..a2f5edc 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -1147,6 +1147,16 @@ static int vis_newindex(lua_State *L) { vis_mode_switch(vis, mode); return 0; } + + if (strcmp(key, "count") == 0) { + int count; + if (lua_isnil(L, 3)) + count = VIS_COUNT_UNKNOWN; + else + count = luaL_checkunsigned(L, 3); + vis_count_set(vis, count); + return 1; + } } return newindex_common(L); } -- cgit v1.2.3