commit - a3f7420310be0fd778ef9fe2abf20edc2d8dc81a
commit + 7473a8d1a57e5f9aba41b953f4e498c35e1c9dc5
blob - 034954d0aa83de340560498116a75930bc1b3db9
blob + 77c3e8a8d8d16e3004760a0432af437065e41fb6
--- st.c
+++ st.c
typedef struct {
Glyph attr; /* current char attributes */
- int x;
- int y;
+ int x; /* terminal column */
+ int y; /* terminal row */
char state;
} TCursor;
void
tcontrolcode(uchar ascii)
{
+ size_t i;
+
switch (ascii) {
case '\t': /* HT */
tputtab(1);
return;
case '\b': /* BS */
- tmoveto(term.c.x-1, term.c.y);
+ for (i = 1; term.c.x && term.line[term.c.y][term.c.x - i].u == 0; ++i)
+ ;
+ tmoveto(term.c.x - i, term.c.y);
return;
case '\r': /* CR */
tmoveto(0, term.c.y);