aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-03-24 13:38:34 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-03-24 13:46:59 +0100
commitd555c905bfd2aed879a912da7b4446b6374981ee (patch)
treedab0f2d3fbf262f6cb2ba79f2e3d5fb7d4455a09
parentf3fd9c3cd1f2e15e89f9cd96d07c1ba957ae7c89 (diff)
downloadvis-d555c905bfd2aed879a912da7b4446b6374981ee.tar.gz
vis-d555c905bfd2aed879a912da7b4446b6374981ee.tar.xz
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.
-rw-r--r--vis-lua.c6
-rw-r--r--vis.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/vis-lua.c b/vis-lua.c
index dbb5d86..b388632 100644
--- 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
index 8f09491..19e0cdb 100644
--- 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);