summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-10-11 22:35:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-10-11 22:35:11 +0000
commit47bf08d94ad6bc636442f6dddc9b75c9a8f14525 (patch)
treeee7773d73a99bff9da942a4d8f46bfa1574434d6
parent3648b30697c5fa3488d81dad67041eba16f50ddc (diff)
Like linefeed, don't set the scroll region for reverse index unless it will be
needed. While here, also tidy up a couple of long lines and remove an extraneous blank.
-rw-r--r--usr.bin/tmux/tty.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index c4adaa9ece7..eb5a533ce2b 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.37 2009/10/10 10:36:46 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.38 2009/10/11 22:35:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -462,8 +462,10 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
if (screen_check_selection(s, i, py)) {
memcpy(&tmpgc, &s->sel.cell, sizeof tmpgc);
tmpgc.data = gc->data;
- tmpgc.flags = gc->flags & ~(GRID_FLAG_FG256|GRID_FLAG_BG256);
- tmpgc.flags |= s->sel.cell.flags & (GRID_FLAG_FG256|GRID_FLAG_BG256);
+ tmpgc.flags = gc->flags &
+ ~(GRID_FLAG_FG256|GRID_FLAG_BG256);
+ tmpgc.flags |= s->sel.cell.flags &
+ (GRID_FLAG_FG256|GRID_FLAG_BG256);
tty_cell(tty, &tmpgc, gu);
} else
tty_cell(tty, gc, gu);
@@ -671,11 +673,9 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
return;
}
- tty_reset(tty);
-
- tty_region(tty, ctx->orupper, ctx->orlower, wp->yoff);
-
if (ctx->ocy == ctx->orupper) {
+ tty_reset(tty);
+ tty_region(tty, ctx->orupper, ctx->orlower, wp->yoff);
tty_cursor(tty, ctx->ocx, ctx->orupper, wp->xoff, wp->yoff);
tty_putcode(tty, TTYC_RI);
}
@@ -693,7 +693,6 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
return;
}
-
if (ctx->ocy == ctx->orlower) {
tty_reset(tty);
tty_region(tty, ctx->orupper, ctx->orlower, wp->yoff);