From 831f0f71f280dba7923861433bdea03d4f030a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 8 Nov 2020 02:15:18 +0100 Subject: toggle between dot mode and normal mode --- tea.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tea.c') 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; -- cgit v1.2.3