Recently Written · git

sacc

Mirror of git://bitreich.org/sacc, the sacc gopher client from bitreich.org.

git clone https://github.com/equwal/sacc

Log | Files | Refs


commit fe6bd5b52afc219737bd22f94ec3d679ac624de3
Quentin Rameau <quinq@fifth.space>
2020-09-26 17:14:45 +0200

ui_ti: replace manual padding with clr_eol

Thanks to Marcin and Hiltjo for the hint!

 ui_ti.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/ui_ti.c b/ui_ti.c
index d62ec20..e81680f 100644
--- a/ui_ti.c
+++ b/ui_ti.c
@@ -66,8 +66,7 @@ uiprompt(char *fmt, ...)
 	n = mbsprint(bufout, columns);
 
 	putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0));
-	if (n < columns)
-		printf("%*s", columns - n, " ");
+	putp(tparm(clr_eol, 0, 0, 0, 0, 0, 0, 0, 0, 0));
 
 	putp(tparm(cursor_address, lines-1, n, 0, 0, 0, 0, 0, 0, 0));
 
@@ -157,8 +156,7 @@ uistatus(char *fmt, ...)
 
 	n = mbsprint(bufout, columns);
 	putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0));
-	if (n < columns)
-		printf("%*s", columns - n, " ");
+	putp(tparm(clr_eol, 0, 0, 0, 0, 0, 0, 0, 0, 0));
 
 	putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0));
 	fflush(stdout);
@@ -188,8 +186,7 @@ displaystatus(Item *item)
 		bufout[sizeof(bufout)-1] = '\0';
 	n = mbsprint(bufout, columns);
 	putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0));
-	if (n < columns)
-		printf("%*s", columns - n, " ");
+	putp(tparm(clr_eol, 0, 0, 0, 0, 0, 0, 0, 0, 0));
 
 	putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0));
 	fflush(stdout);
@@ -243,8 +240,7 @@ displayuri(Item *item)
 
 	n = mbsprint(bufout, columns);
 	putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0));
-	if (n < columns)
-		printf("%*s", columns - n, " ");
+	putp(tparm(clr_eol, 0, 0, 0, 0, 0, 0, 0, 0, 0));
 
 	putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0));
 	fflush(stdout);