Compare to see if pane status line has actually changed, not just size, and

do not draw if pane is not visible.
pull/581/head
nicm 2016-10-12 17:36:52 +00:00
parent e83ebf50de
commit e0add119ea
1 changed files with 12 additions and 3 deletions

View File

@ -269,8 +269,9 @@ screen_redraw_make_pane_status(struct client *c, struct window *w,
const char *fmt;
struct format_tree *ft;
char *out;
size_t outlen, old_size = wp->status_size;
size_t outlen;
struct screen_write_ctx ctx;
struct screen old;
if (wp == w->active)
style_apply(&gc, w->options, "pane-active-border-style");
@ -282,7 +283,7 @@ screen_redraw_make_pane_status(struct client *c, struct window *w,
ft = format_create(NULL, 0);
format_defaults(ft, c, NULL, NULL, wp);
screen_free(&wp->status_screen);
memcpy(&old, &wp->status_screen, sizeof old);
screen_init(&wp->status_screen, wp->sx, 1, 0);
wp->status_screen.mode = 0;
@ -301,7 +302,13 @@ screen_redraw_make_pane_status(struct client *c, struct window *w,
format_free(ft);
wp->status_size = outlen;
return (wp->status_size != old_size);
if (grid_compare(wp->status_screen.grid, old.grid) == 0) {
screen_free(&old);
return (0);
}
screen_free(&old);
return (1);
}
/* Draw pane status. */
@ -317,6 +324,8 @@ screen_redraw_draw_pane_status(struct client *c, int pane_status)
spos = options_get_number(oo, "status-position");
TAILQ_FOREACH(wp, &w->panes, entry) {
if (!window_pane_visible(wp))
continue;
if (pane_status == CELL_STATUS_TOP)
yoff = wp->yoff - 1;
else