diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-14 19:29:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-14 19:29:32 +0000 |
commit | b4ac8c1342184d6a81985704c154f3a3e744fffd (patch) | |
tree | 8123c107b14d67631bfda6ca0dd94e261f3b1dc0 /screen-redraw.c | |
parent | e02496f073886eed4b1f83db0c4eb65cce4c54ec (diff) |
Multiple window splitting.
Diffstat (limited to 'screen-redraw.c')
-rw-r--r-- | screen-redraw.c | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/screen-redraw.c b/screen-redraw.c index f8c8eed5..2094bb6f 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -1,4 +1,4 @@ -/* $Id: screen-redraw.c,v 1.17 2009-01-12 18:22:47 nicm Exp $ */ +/* $Id: screen-redraw.c,v 1.18 2009-01-14 19:29:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -23,7 +23,7 @@ #include "tmux.h" void screen_redraw_blankx(struct client *, u_int, u_int); -void screen_redraw_blanky(struct client *, u_int, u_int); +void screen_redraw_blanky(struct client *, u_int, u_int, char); void screen_redraw_line(struct client *, struct screen *, u_int, u_int); /* Redraw entire screen.. */ @@ -42,38 +42,24 @@ screen_redraw_screen(struct client *c, struct screen *s) return; } - /* - * A normal client screen is made up of three parts: a top window, a - * bottom window and a status line. The bottom window may be turned - * off; the status line is always drawn. - */ - - /* Draw the top window. */ - wp = w->panes[0]; - s = wp->screen; - - sy = screen_size_y(s); - if (screen_size_y(s) == c->sy && w->panes[1] == NULL) - sy--; - cx = s->cx; - cy = s->cy; - for (i = 0; i < sy; i++) - screen_redraw_line(c, s, wp->yoff, i); - s->cx = cx; - s->cy = cy; - - /* Draw the bottom window. */ - if (c->sy > 2 && w->panes[1] != NULL) { - wp = w->panes[1]; + status = options_get_number(&c->session->options, "status"); + + /* Draw the panes. */ + TAILQ_FOREACH(wp, &w->panes, entry) { s = wp->screen; sy = screen_size_y(s); - if (wp->yoff + screen_size_y(s) == s->cy) + if (!status && TAILQ_NEXT(wp, entry) == NULL) sy--; + cx = s->cx; cy = s->cy; - for (i = 0; i < sy; i++) - screen_redraw_line(c, s, wp->yoff, i); + if (wp->yoff + sy <= w->sy) { + for (i = 0; i < sy; i++) + screen_redraw_line(c, s, wp->yoff, i); + if (TAILQ_NEXT(wp, entry) != NULL) + screen_redraw_blanky(c, wp->yoff + sy, 1, '-'); + } s->cx = cx; s->cy = cy; } @@ -82,12 +68,7 @@ screen_redraw_screen(struct client *c, struct screen *s) if (w->sx < c->sx) screen_redraw_blankx(c, w->sx, c->sx - w->sx); if (w->sy < c->sy - status) - screen_redraw_blanky(c, w->sy, c->sy - w->sy); - - /* Draw separator line. */ - s = w->panes[0]->screen; - if (c->sy > 1 && screen_size_y(s) != w->sy) - screen_redraw_blanky(c, screen_size_y(s), 1); + screen_redraw_blanky(c, w->sy, c->sy - w->sy, '='); /* Draw the status line. */ screen_redraw_status(c); @@ -120,7 +101,7 @@ screen_redraw_blankx(struct client *c, u_int ox, u_int nx) /* Draw blank lines. */ void -screen_redraw_blanky(struct client *c, u_int oy, u_int ny) +screen_redraw_blanky(struct client *c, u_int oy, u_int ny, char ch) { u_int i, j; @@ -129,7 +110,7 @@ screen_redraw_blanky(struct client *c, u_int oy, u_int ny) tty_putcode2(&c->tty, TTYC_CUP, oy + j, 0); for (i = 0; i < c->sx; i++) { if (j == 0) - tty_putc(&c->tty, '-'); + tty_putc(&c->tty, ch); else tty_putc(&c->tty, ' '); } |