vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit a9879d407e3c2dc450994fec8c7394a2ab4ab6e2 parent 2044ae7dcb56f8a1d258da9fa47f43df53146505 Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 8 Dec 2016 11:50:00 +0100 vis-lua: only fail file_save_pre event if explicitly returned false Previously we would also interpret a missing return value `nil` as is the case when no pre save event handler is subscribed as failure. Diffstat:
| M | vis-lua.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vis-lua.c b/vis-lua.c @@ -2049,7 +2049,7 @@ bool vis_lua_file_save_pre(Vis *vis, File *file, const char *path) { lua_pushstring(L, path); if (pcall(vis, L, 2, 1) != 0) return false; - return lua_toboolean(L, -1); + return !lua_isboolean(L, -1) || lua_toboolean(L, -1); } lua_pop(L, 1); return true;