diff options
Diffstat (limited to '')
| -rw-r--r-- | st.c | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -86,8 +86,8 @@ enum escape_state { | |||
| 86 | 86 | ||
| 87 | typedef struct { | 87 | typedef struct { |
| 88 | Glyph attr; /* current char attributes */ | 88 | Glyph attr; /* current char attributes */ |
| 89 | int x; | 89 | int x; /* terminal column */ |
| 90 | int y; | 90 | int y; /* terminal row */ |
| 91 | char state; | 91 | char state; |
| 92 | } TCursor; | 92 | } TCursor; |
| 93 | 93 | ||
| @@ -2175,12 +2175,16 @@ tstrsequence(uchar c) | |||
| 2175 | void | 2175 | void |
| 2176 | tcontrolcode(uchar ascii) | 2176 | tcontrolcode(uchar ascii) |
| 2177 | { | 2177 | { |
| 2178 | size_t i; | ||
| 2179 | |||
| 2178 | switch (ascii) { | 2180 | switch (ascii) { |
| 2179 | case '\t': /* HT */ | 2181 | case '\t': /* HT */ |
| 2180 | tputtab(1); | 2182 | tputtab(1); |
| 2181 | return; | 2183 | return; |
| 2182 | case '\b': /* BS */ | 2184 | case '\b': /* BS */ |
| 2183 | tmoveto(term.c.x-1, term.c.y); | 2185 | for (i = 1; term.c.x && term.line[term.c.y][term.c.x - i].u == 0; ++i) |
| 2186 | ; | ||
| 2187 | tmoveto(term.c.x - i, term.c.y); | ||
| 2184 | return; | 2188 | return; |
| 2185 | case '\r': /* CR */ | 2189 | case '\r': /* CR */ |
| 2186 | tmoveto(0, term.c.y); | 2190 | tmoveto(0, term.c.y); |
