diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-05-07 07:16:15 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-05-07 07:16:15 +0000 |
commit | da2766bb6436a54ab2bfb9fa2523f09a896f479d (patch) | |
tree | cb81eeff23136fb69d49090661ce1d5f9ab264de /usr.bin | |
parent | 41de0c15a8eb267e0dc5a133b165ece0ad21af5f (diff) |
If status line is at the top, the offset needs to be adjusted when
drawing pane numbers. Based on a diff from John O'Meara.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/screen-redraw.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c index 16dafedaed5..396500cf4a8 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.30 2015/04/19 21:05:27 nicm Exp $ */ +/* $OpenBSD: screen-redraw.c,v 1.31 2015/05/07 07:16:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -32,7 +32,7 @@ int screen_redraw_check_active(u_int, u_int, int, struct window *, void screen_redraw_draw_borders(struct client *, int, u_int); void screen_redraw_draw_panes(struct client *, u_int); void screen_redraw_draw_status(struct client *, u_int); -void screen_redraw_draw_number(struct client *, struct window_pane *); +void screen_redraw_draw_number(struct client *, struct window_pane *, u_int); #define CELL_INSIDE 0 #define CELL_LEFTRIGHT 1 @@ -354,7 +354,7 @@ screen_redraw_draw_panes(struct client *c, u_int top) for (i = 0; i < wp->sy; i++) tty_draw_pane(tty, wp, i, wp->xoff, top + wp->yoff); if (c->flags & CLIENT_IDENTIFY) - screen_redraw_draw_number(c, wp); + screen_redraw_draw_number(c, wp, top); } } @@ -372,7 +372,7 @@ screen_redraw_draw_status(struct client *c, u_int top) /* Draw number on a pane. */ void -screen_redraw_draw_number(struct client *c, struct window_pane *wp) +screen_redraw_draw_number(struct client *c, struct window_pane *wp, u_int top) { struct tty *tty = &c->tty; struct session *s = c->session; @@ -396,6 +396,9 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp) px = wp->sx / 2; py = wp->sy / 2; xoff = wp->xoff; yoff = wp->yoff; + if (top) + yoff++; + if (wp->sx < len * 6 || wp->sy < 5) { tty_cursor(tty, xoff + px - len / 2, yoff + py); goto draw_text; |