diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-03-27 16:44:51 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-03-27 16:44:51 +0000 |
commit | f6001f9ffc269dfec3c84f4f25d9561d845b8b01 (patch) | |
tree | 94c332677c78aa57ebd1d313379cb5c0dcf864bb | |
parent | b97264bb70898465fbdba6a79cd1614b0f09c0fc (diff) |
Whoops. Didn't mean to commit this yet.
-rw-r--r-- | screen-redraw.c | 20 | ||||
-rw-r--r-- | tmux.h | 3 | ||||
-rw-r--r-- | tty.c | 51 |
3 files changed, 36 insertions, 38 deletions
diff --git a/screen-redraw.c b/screen-redraw.c index 7752705d..11147e02 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -1,4 +1,4 @@ -/* $Id: screen-redraw.c,v 1.27 2009-03-27 16:44:00 nicm Exp $ */ +/* $Id: screen-redraw.c,v 1.28 2009-03-27 16:44:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -128,5 +128,21 @@ screen_redraw_blanky(struct client *c, u_int oy, u_int ny, char ch) void screen_redraw_line(struct client *c, struct screen *s, u_int oy, u_int py) { - tty_draw_line(&c->tty, s, py, oy); + const struct grid_cell *gc; + struct grid_cell tc; + u_int i, sx; + + sx = screen_size_x(s); + if (sx > c->tty.sx) + sx = c->tty.sx; + for (i = 0; i < sx; i++) { + gc = grid_view_peek_cell(s->grid, i, py); + tty_cursor(&c->tty, i, py, oy); + if (screen_check_selection(s, i, py)) { + memcpy(&tc, &s->sel.cell, sizeof tc); + tc.data = gc->data; + tty_cell(&c->tty, &tc); + } else + tty_cell(&c->tty, gc); + } } @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.282 2009-03-27 16:44:00 nicm Exp $ */ +/* $Id: tmux.h,v 1.283 2009-03-27 16:44:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1065,7 +1065,6 @@ void tty_start_tty(struct tty *); void tty_stop_tty(struct tty *); void tty_set_title(struct tty *, const char *); void tty_update_mode(struct tty *, int); -void tty_draw_line(struct tty *, struct screen *, u_int, u_int); int tty_open(struct tty *, char **); void tty_close(struct tty *, int); void tty_free(struct tty *, int); @@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.81 2009-03-27 16:44:00 nicm Exp $ */ +/* $Id: tty.c,v 1.82 2009-03-27 16:44:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -32,6 +32,7 @@ u_char tty_get_acs(struct tty *, u_char); void tty_emulate_repeat( struct tty *, enum tty_code_code, enum tty_code_code, u_int); +void tty_draw_line(struct tty *, struct window_pane *, u_int); void tty_raw(struct tty *, const char *); @@ -379,41 +380,23 @@ tty_emulate_repeat( } void -tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int oy) +tty_draw_line(struct tty *tty, struct window_pane *wp, u_int py) { - const struct grid_cell *gc; + struct screen *s = wp->screen; + const struct grid_cell *gc; struct grid_cell tc; - u_int i, sx; - - sx = screen_size_x(s); - if (sx > tty->sx) - sx = tty->sx; - if (sx > s->grid->size[s->grid->hsize + py]) - sx = s->grid->size[s->grid->hsize + py]; + u_int i; - for (i = 0; i < sx; i++) { + for (i = 0; i < tty->sx; i++) { gc = grid_view_peek_cell(s->grid, i, py); + tty_cursor(tty, i, py, wp->yoff); if (screen_check_selection(s, i, py)) { memcpy(&tc, &s->sel.cell, sizeof tc); tc.data = gc->data; - gc = &tc; - } - - tty_cursor(tty, i, py, oy); - tty_cell(tty, gc); - } - - if (sx >= s->grid->size[s->grid->hsize + py]) - return; - tty_reset(tty); - - tty_cursor(tty, sx, py, oy); - if (tty_term_has(tty->term, TTYC_EL)) - tty_putcode(tty, TTYC_EL); - else { - for (i = sx; i < screen_size_x(s); i++) - tty_putc(tty, ' '); + tty_cell(tty, &tc); + } else + tty_cell(tty, gc); } } @@ -486,10 +469,10 @@ tty_cmd_insertline(struct tty *tty, struct window_pane *wp, va_list ap) */ if (s->old_cy < s->old_rupper || s->old_cy > s->old_rlower) { for (i = s->old_cy; i < screen_size_y(s); i++) - tty_draw_line(tty, wp->screen, i, wp->yoff); + tty_draw_line(tty, wp, i); } else { for (i = s->old_rupper; i <= s->old_rlower; i++) - tty_draw_line(tty, wp->screen, i, wp->yoff); + tty_draw_line(tty, wp, i); } return; } @@ -517,10 +500,10 @@ tty_cmd_deleteline(struct tty *tty, struct window_pane *wp, va_list ap) */ if (s->old_cy < s->old_rupper || s->old_cy > s->old_rlower) { for (i = s->old_cy; i < screen_size_y(s); i++) - tty_draw_line(tty, wp->screen, i, wp->yoff); + tty_draw_line(tty, wp, i); } else { for (i = s->old_rupper; i <= s->old_rlower; i++) - tty_draw_line(tty, wp->screen, i, wp->yoff); + tty_draw_line(tty, wp, i); } return; } @@ -602,7 +585,7 @@ tty_cmd_reverseindex(struct tty *tty, struct window_pane *wp, unused va_list ap) */ if (s->old_cy == s->old_rupper) { for (i = s->old_rupper; i <= s->old_rlower; i++) - tty_draw_line(tty, wp->screen, i, wp->yoff); + tty_draw_line(tty, wp, i); } return; } @@ -630,7 +613,7 @@ tty_cmd_linefeed(struct tty *tty, struct window_pane *wp, unused va_list ap) */ if (s->old_cy == s->old_rlower) { for (i = s->old_rupper; i <= s->old_rlower; i++) - tty_draw_line(tty, wp->screen, i, wp->yoff); + tty_draw_line(tty, wp, i); return; } } |