aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-10-12 16:41:02 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-10-12 16:41:02 +0000
commit693b3d03e66e5ab2f4c4e31b7d5d2c1629afbd8c (patch)
tree492bd82f321a58e5431d9508027928c37df98199 /tty.c
parenteb9826f65d5584bc791cb35eb91ab6a5894b888c (diff)
downloadrtmux-693b3d03e66e5ab2f4c4e31b7d5d2c1629afbd8c.tar.gz
rtmux-693b3d03e66e5ab2f4c4e31b7d5d2c1629afbd8c.tar.bz2
rtmux-693b3d03e66e5ab2f4c4e31b7d5d2c1629afbd8c.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 'tty.c')
-rw-r--r--tty.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tty.c b/tty.c
index 29c84832..53e017bc 100644
--- a/tty.c
+++ b/tty.c
@@ -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)) {