vis

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

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

commit da28390de51c7c7597f0d15b40a530f88277f1a6
parent 0d3a998c649f14dc356a297fd78b112cecac87dd
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Wed, 18 May 2016 14:34:44 +0200

vis-lua: fail more silently when visrc.lua can not be loaded

This prevents opening a separate window to display a full stack
trace and improves usage of a vis binary compiled with lua support
on a system without the necessary *.lua files.

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

diff --git a/vis-lua.c b/vis-lua.c @@ -1178,7 +1178,8 @@ void vis_lua_init(Vis *vis) { lua_getglobal(L, "require"); lua_pushstring(L, "visrc"); - pcall(vis, L, 1, 0); + if (lua_pcall(L, 1, 0, 0)) + vis_info_show(vis, "WARNING: failed to load visrc.lua"); } void vis_lua_start(Vis *vis) {