vis

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

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

commit 694cdeb2aa192504170b6b37122999199f5b842f
parent dc5885b40eee26ce775335ae7095bc5c516e4d2b
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sat, 27 May 2017 20:15:19 +0200

vis-lua: avoid nil values in table returned by vis:mapping

Also fix compilation with ./configure --disable-help.

Diffstat:
Mvis-lua.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vis-lua.c b/vis-lua.c @@ -951,7 +951,8 @@ static bool binding_collect(const char *key, void *value, void *ctx) { bool new = lua_isnil(L, -1); lua_pop(L, 1); if (new) { - lua_pushstring(L, binding->alias ? binding->alias : binding->action->help); + const char *help = binding->alias ? binding->alias : VIS_HELP_USE(binding->action->help); + lua_pushstring(L, help ? help : ""); lua_setfield(L, -2, key); } return true;