summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-10-12 16:41:02 +0000
committernicm <nicm@openbsd.org>2009-10-12 16:41:02 +0000
commit0b648092404eda0b6b4eb2040124cb8a6fcad451 (patch)
tree8f3450b062117396ce58203f5051319c13583c4a /usr.bin/tmux/tty.c
parentIf the vertical cursor movement crosses the scroll region, CUU and CUD (diff)
downloadwireguard-openbsd-0b648092404eda0b6b4eb2040124cb8a6fcad451.tar.xz
wireguard-openbsd-0b648092404eda0b6b4eb2040124cb8a6fcad451.zip
Don't run through the column unchanged case if the row was unchanged but there
were no suitable optimisations, instead make it an else to fall through to absolute addressing.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index b1c3c9d2bbd..04484754705 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.44 2009/10/12 16:37:43 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.45 2009/10/12 16:41:02 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -968,8 +968,12 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
goto out;
}
- /* Row staying the same. */
+ /* Moving column or row. */
if (cy == thisy) {
+ /*
+ * Moving column only, row staying the same.
+ */
+
/* To left edge. */
if (cx == 0) {
tty_putc(tty, '\r');
@@ -1005,10 +1009,11 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
tty_putcode1(tty, TTYC_CUF, -change);
goto out;
}
- }
+ } else if (cx == thisx) {
+ /*
+ * Moving row only, column staying the same.
+ */
- /* Column staying the same. */
- if (cx == thisx ) {
/* One above. */
if (cy != tty->rupper &&
cy == thisy - 1 && tty_term_has(term, TTYC_CUU1)) {