Skip to content

Commit

Permalink
vis-lua: make vis:count assignable
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Feb 23, 2017
1 parent bfd007c commit dddf34d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vis-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit dddf34d

Please sign in to comment.