aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-11-08 02:15:18 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-11-08 02:15:18 +0100
commit831f0f71f280dba7923861433bdea03d4f030a3c (patch)
tree91aeff34260724affb5fc10450f7d269fa832183
parentaf2265d59a0cbeff953af2d7a3e2765df82ecfb2 (diff)
downloadtea-831f0f71f280dba7923861433bdea03d4f030a3c.tar.gz
toggle between dot mode and normal modeHEADmaster
-rw-r--r--tea.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tea.c b/tea.c
index db1239d..3797c21 100644
--- a/tea.c
+++ b/tea.c
@@ -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;