From 7cd3cf0eada8513907cd1cc78d7669752235f419 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 12 Jan 2009 18:22:47 +0000 Subject: Make the window pane code handle panes of different sizes, and add a -l and -p arguments to split-window to specify the new window size in lines or as a percentage. --- status.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'status.c') diff --git a/status.c b/status.c index 6efe6f51..147b9b05 100644 --- a/status.c +++ b/status.c @@ -1,4 +1,4 @@ -/* $Id: status.c,v 1.60 2009-01-11 23:31:46 nicm Exp $ */ +/* $Id: status.c,v 1.61 2009-01-12 18:22:47 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -258,18 +258,17 @@ off: * status is off. Not sure this is the right place for this. */ screen_write_start(&ctx, NULL, &c->status); - wp = s->curw->window->panes[1]; - sy = c->sy - (c->sy / 2); - if (wp == NULL) { - wp = s->curw->window->panes[0]; - sy = c->sy; + wp = s->curw->window->panes[0]; + sy = wp->sy; + if (s->curw->window->panes[1] != NULL) { + wp = s->curw->window->panes[1]; + sy += wp->sy + 1; } screen_write_cursormove(&ctx, 0, 0); - if (screen_size_y(wp->screen) < sy) { + if (sy < c->sy - 1) { /* If the screen is too small, use blank. */ for (offset = 0; offset < c->sx; offset++) screen_write_putc(&ctx, &gc, ' '); - abort(); } else { screen_write_copy(&ctx, wp->screen, 0, wp->screen->grid->hsize + screen_size_y(wp->screen) - 1, c->sx, 1); -- cgit