From 66abbf4d0da4532ef0e109b144ebf8aa09d40886 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 12 Sep 2012 23:50:42 -0700 Subject: [PATCH] Work around missing column_address with left/right. --- Display.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Display.cpp b/Display.cpp index 5e45c45..1881ccd 100644 --- a/Display.cpp +++ b/Display.cpp @@ -94,15 +94,23 @@ CYCursor CYDisplayOutput(int (*put)(int), int width, const char *data, ssize_t o return point; } -void CYDisplayMove(CYCursor target) { - int offset(target.real() - current_.real()); - +void CYDisplayMove_(char *negative, char *positive, int offset) { if (offset < 0) - putp(tparm(parm_up_cursor, -offset)); + putp(tparm(negative, -offset)); else if (offset > 0) - putp(tparm(parm_down_cursor, offset)); + putp(tparm(positive, offset)); +} + +void CYDisplayMove(CYCursor target) { + CYCursor offset(target - current_); + + CYDisplayMove_(parm_up_cursor, parm_down_cursor, offset.real()); + + if (char *parm = tparm(column_address, target.imag())) + putp(parm); + else + CYDisplayMove_(parm_left_cursor, parm_right_cursor, offset.imag()); - putp(tparm(column_address, target.imag())); current_ = target; } -- 2.47.2