diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-23 07:43:52 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-23 07:43:52 +0100 |
| commit | dddf34dac6d462d536c33e5bcc63fd61b106066d (patch) | |
| tree | d072cfed1fc8e74fac8689dd182f4527642fd4df /vis-lua.c | |
| parent | bfd007ca946c06d1d5743a0dcf97d454d27ec6e3 (diff) | |
| download | vis-dddf34dac6d462d536c33e5bcc63fd61b106066d.tar.gz vis-dddf34dac6d462d536c33e5bcc63fd61b106066d.tar.xz | |
vis-lua: make vis:count assignable
Diffstat (limited to 'vis-lua.c')
| -rw-r--r-- | vis-lua.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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); } |
