vis

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

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

commit 4811a653ca9ea10408bef8d2a79b3d24635d9a4d
parent 4eb3e283df37d3f69db112b63f469ac85d39e188
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri, 24 Mar 2017 13:38:34 +0100

vis: properly redraw status bar of windows displaying internal files

Currently the only "internal window" with a status bar is the information
window used to display Lua stack traces. We do not want to trigger events
for it, because that could result in further Lua errors. Nonetheless its
status bar should be properly redrawn to avoid display artifacts. That is
why we fall back to the built-in default status bar as used by non-Lua
builds.

Diffstat:
Mvis-lua.c | 6+++---
Mvis.c | 2+-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/vis-lua.c b/vis-lua.c @@ -227,8 +227,6 @@ static int panic_handler(lua_State *L) { if (ud) { Vis *vis = ud; vis->lua = NULL; - if (vis->event) - vis->event->win_status = window_status_update; const char *msg = NULL; if (lua_type(L, -1) == LUA_TSTRING) msg = lua_tostring(L, -1); @@ -2845,8 +2843,10 @@ void vis_lua_win_highlight(Vis *vis, Win *win) { */ void vis_lua_win_status(Vis *vis, Win *win) { lua_State *L = vis->lua; - if (!L) + if (!L || win->file->internal) { + window_status_update(vis, win); return; + } vis_lua_event_get(L, "win_status"); if (lua_isfunction(L, -1)) { obj_ref_new(L, win, VIS_LUA_TYPE_WINDOW); diff --git a/vis.c b/vis.c @@ -108,7 +108,7 @@ bool vis_event_emit(Vis *vis, enum VisEvents id, ...) { case VIS_EVENT_WIN_STATUS: { Win *win = va_arg(ap, Win*); - if (win->file->internal) + if (win->file->internal && id != VIS_EVENT_WIN_STATUS) break; if (vis->event->win_open && id == VIS_EVENT_WIN_OPEN) { vis->event->win_open(vis, win);