+void
+vt102_cursor_retreat_line (Context * c)
+{
+ VT102 *v = c->v;
+ int couldscroll = in_margins (v, v->pos);
+
+/*have wraped off end of last line in scrolling region */
+/* (|| not necessary, but shuts compiler up */
+ if (((v->pos.y == v->top_margin.y) || (v->pos.y == v->screen_start.y)) &&
+ (couldscroll))
+ {
+ vt102_log_line (c, v->pos.y);
+
+ crt_scroll_down (&v->crt, v->top_margin, v->bottom_margin, 1, v->color);
+ return;
+ }
+
+ if (v->pos.y != v->screen_start.y)
+ v->pos.y--;
+ v->pending_wrap = 0;
+}
+
+