diff options
author | 2016-10-12 17:36:52 +0000 | |
---|---|---|
committer | 2016-10-12 17:36:52 +0000 | |
commit | be29cab131cf359381f419bf524f53dffb3e257d (patch) | |
tree | 678e7f47466de9ed9e5b3a5a902811c56a2c5d28 | |
parent | Document the "-q " prefix accepted in the "command" field. (diff) | |
download | wireguard-openbsd-be29cab131cf359381f419bf524f53dffb3e257d.tar.xz wireguard-openbsd-be29cab131cf359381f419bf524f53dffb3e257d.zip |
Compare to see if pane status line has actually changed, not just size, and
do not draw if pane is not visible.
-rw-r--r-- | usr.bin/tmux/screen-redraw.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c index 634f6ad8051..27d9effd060 100644 --- a/usr.bin/tmux/screen-redraw.c +++ b/usr.bin/tmux/screen-redraw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-redraw.c,v 1.39 2016/10/10 21:29:23 nicm Exp $ */ +/* $OpenBSD: screen-redraw.c,v 1.40 2016/10/12 17:36:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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 |