From cdafcf05b3a0707f99414dad8cac69d8f87d82f0 Mon Sep 17 00:00:00 2001 From: Ondrej Martinek Date: Thu, 21 Mar 2019 13:47:58 +0000 Subject: fix acceptance tests --- src/tty_interface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/tty_interface.c') diff --git a/src/tty_interface.c b/src/tty_interface.c index 918c0c6..343dde8 100644 --- a/src/tty_interface.c +++ b/src/tty_interface.c @@ -109,8 +109,13 @@ static void draw(tty_interface_t *state) { } } - tty_moveup(tty, num_lines + (options->show_info ? 1 : 0)); - tty_setcol(tty, strlen(options->prompt) + state->cursor); + if (num_lines + options->show_info) + tty_moveup(tty, num_lines + options->show_info); + + tty_setcol(tty, 0); + fputs(options->prompt, tty->fout); + for (size_t i = 0; i < state->cursor; i++) + fputc(state->search[i], tty->fout); tty_flush(tty); } -- cgit v1.2.3