tui_ti: replace manual padding with clr_eol - sacc - sacc(omys), simple console gopher client (mirror) HTML git clone https://git.parazyd.org/sacc DIR Log DIR Files DIR Refs DIR LICENSE --- DIR commit fe6bd5b52afc219737bd22f94ec3d679ac624de3 DIR parent c0a79c0424a99180ed4c79e3335dc3f7ced2322c HTML Author: Quentin Rameau <quinq@fifth.space> Date: Sat, 26 Sep 2020 17:14:45 +0200 ui_ti: replace manual padding with clr_eol Thanks to Marcin and Hiltjo for the hint! Diffstat: M ui_ti.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) --- DIR diff --git a/ui_ti.c b/ui_ti.c t@@ -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)); t@@ -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); t@@ -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); t@@ -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);