diff options
author | Rich Felker <dalias@aerifal.cx> | 2006-12-09 05:14:41 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2006-12-09 05:14:41 +0000 |
commit | 2b8bb3682bc64210d3bef9dee6cd4067e1da9f10 (patch) | |
tree | 655421ec0e7088f98aa6f72d92b72894018ea7e2 | |
parent | 191afaf695ae93c1cd3117c373aa1789f862e34f (diff) |
maybe not quite correct, but this fixes some major automargin-related
glitches (automargin flag was cleared on all escapes, not just ones
that move the cursor).
-rw-r--r-- | term.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -140,19 +140,23 @@ static void csi(struct uuterm *t, unsigned c) case 'a': case 'C': t->x += t->param[0]; + t->am = 0; break; case 'D': t->x -= t->param[0]; + t->am = 0; break; case '`': case 'G': t->x = t->param[0]-1; + t->am = 0; break; case 'f': case 'H': if (!t->param[1]) t->param[1]++; t->y = t->param[0]-1; t->x = t->param[1]-1; + t->am = 0; break; case 'J': erase_display(t, t->param[0]); @@ -259,6 +263,7 @@ static void csi(struct uuterm *t, unsigned c) case 'u': t->x = t->save_x; t->y = t->save_y; + t->am = 0; break; case '[': t->esc = IGNORE1; @@ -320,6 +325,7 @@ static void escape(struct uuterm *t, unsigned c) t->attr = t->save_attr; t->x = t->save_x; t->y = t->save_y; + t->am = 0; break; case '[': t->esc = CSI; @@ -364,6 +370,7 @@ static void process_char(struct uuterm *t, unsigned c) break; case '\r': t->x = 0; + t->am = 0; break; case '\n': if (t->y == t->sr_y2) scroll(t, t->sr_y1, t->sr_y2, 0); @@ -371,10 +378,15 @@ static void process_char(struct uuterm *t, unsigned c) break; case '\t': t->x = (t->x + 8) & ~7; - if (t->x >= t->w) t->x = t->w - 1; + t->am = 1; + if (t->x >= t->w) + t->x = t->w - 1; + else + t->am = 0; break; case '\b': if (!t->am && t->x) t->x--; + t->am = 0; break; case '\a': bell(t); @@ -383,7 +395,6 @@ static void process_char(struct uuterm *t, unsigned c) process_char(t, 0xfffd); break; } - t->am = 0; break; case 0: y = t->y; |