vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 502c3b42d12c64d2e30355a1ac88b8da4ff7fee6
parent 882e4047b8fe68fd82261fea4e2019e795c172aa
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 23 Feb 2017 07:43:52 +0100

vis-lua: make vis:count assignable

Diffstat:
Mvis-lua.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git 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); }