case CYIgnoreStart:
CYDisplayOutput_(put, data);
- ++offset;
- break;
-
case CYIgnoreEnd:
++offset;
break;
default:
- if (put != NULL)
- put(next);
-
current_ += CYCursor(0, 1);
if (current_.imag() == width)
+ case '\n':
current_ = CYCursor(current_.real() + 1, 0);
+ if (put != NULL)
+ put(next);
break;
+
}
}
+}
- return point;
+void CYDisplayMove_(char *negative, char *positive, int offset) {
+ if (offset < 0)
+ putp(tparm(negative, -offset));
+ else if (offset > 0)
+ putp(tparm(positive, offset));
}
void CYDisplayMove(CYCursor target) {
- int offset(target.real() - current_.real());
+ CYCursor offset(target - current_);
- if (offset < 0)
- putp(tparm(parm_up_cursor, -offset));
- else if (offset > 0)
- putp(tparm(parm_down_cursor, offset));
+ 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;
}
if (width_ != width) {
current_ = CYCursor();
CYDisplayOutput(NULL, width, prompt);
- CYDisplayOutput(NULL, width, buffer, point_);
+ current_ = CYDisplayOutput(NULL, width, buffer, point_);
}
CYDisplayMove(CYCursor());