st would always move back 1 column,
even with wide glyhps (using more than a single column).
The glyph rune is set on its first column,
and the other ones are to 0,
so loop until we detect the start of the previous glyph.
typedef struct {
Glyph attr; /* current char attributes */
typedef struct {
Glyph attr; /* current char attributes */
+ int x; /* terminal column */
+ int y; /* terminal row */
void
tcontrolcode(uchar ascii)
{
void
tcontrolcode(uchar ascii)
{
switch (ascii) {
case '\t': /* HT */
tputtab(1);
return;
case '\b': /* BS */
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);
return;
case '\r': /* CR */
tmoveto(0, term.c.y);