diff options
author | John Ankarström <john@ankarstrom.se> | 2020-11-08 02:15:18 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-11-08 02:15:18 +0100 |
commit | 831f0f71f280dba7923861433bdea03d4f030a3c (patch) | |
tree | 91aeff34260724affb5fc10450f7d269fa832183 | |
parent | af2265d59a0cbeff953af2d7a3e2765df82ecfb2 (diff) | |
download | tea-master.tar.gz |
-rw-r--r-- | tea.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -239,11 +239,18 @@ int main() { prn("\b"); delc(); x--; + if (x == 1) { + prn(CSI "0m"); + for (i = 1; i < margin; i++) + prn(" "); + x = margin; + } break; default: if (iscntrl(c)) break; if (x == margin && c == '.') { - prn(CSI "%dD", margin - 1); + prn(CSI "%d;%dH", y, 1); + x = 1; prn(CSI "2m"); } addc(c); @@ -256,6 +263,7 @@ int main() { quit: prn(CSI "%d;%dH", yorig, xorig); prn(CSI "J"); /* delete from cursor to end of display (ED) */ + prn(CSI "0m"); raw(false); printf("%s", src); return 0; |