aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2012-01-23 12:23:27 +0000
committerTiago Cunha <tcunha@gmx.com>2012-01-23 12:23:27 +0000
commit4d80980e50f886fbb168db13bd04da8988f9e498 (patch)
tree78e3481a0d09b228a288b2eeed5c59156b2382b8
parent85152ef35ca6c87af4fcfb32c8ac87a91f2f6ed3 (diff)
downloadrtmux-4d80980e50f886fbb168db13bd04da8988f9e498.tar.gz
rtmux-4d80980e50f886fbb168db13bd04da8988f9e498.tar.bz2
rtmux-4d80980e50f886fbb168db13bd04da8988f9e498.zip
Sync OpenBSD patchset 1010:
Show pane size in top right of display panes mode.
-rw-r--r--screen-redraw.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/screen-redraw.c b/screen-redraw.c
index c9e05420..af02c73b 100644
--- a/screen-redraw.c
+++ b/screen-redraw.c
@@ -286,15 +286,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
if (wp->sx < len * 6 || wp->sy < 5) {
tty_cursor(tty, xoff + px - len / 2, yoff + py);
- memcpy(&gc, &grid_default_cell, sizeof gc);
- gc.data = '_'; /* not space */
- if (w->active == wp)
- colour_set_fg(&gc, active_colour);
- else
- colour_set_fg(&gc, colour);
- tty_attributes(tty, &gc);
- tty_puts(tty, buf);
- return;
+ goto draw_text;
}
px -= len * 3;
@@ -321,4 +313,21 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
}
px += 6;
}
+
+ len = xsnprintf(buf, sizeof buf, "%ux%u", wp->sx, wp->sy);
+ if (wp->sx < len || wp->sy < 6)
+ return;
+ tty_cursor(tty, xoff + wp->sx - len, yoff);
+
+draw_text:
+ memcpy(&gc, &grid_default_cell, sizeof gc);
+ gc.data = '_'; /* not space */
+ if (w->active == wp)
+ colour_set_fg(&gc, active_colour);
+ else
+ colour_set_fg(&gc, colour);
+ tty_attributes(tty, &gc);
+ tty_puts(tty, buf);
+
+ tty_cursor(tty, 0, 0);
}