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 +++++++-- test/acceptance/acceptance_test.rb | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) 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); } diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb index ba3ec01..1370ac8 100644 --- a/test/acceptance/acceptance_test.rb +++ b/test/acceptance/acceptance_test.rb @@ -1,3 +1,4 @@ +# coding: utf-8 require 'minitest' require 'minitest/autorun' require 'ttytest' @@ -458,6 +459,7 @@ Usage: fzy [OPTION]... -s, --show-scores Show the scores of each match -0, --read-null Read input delimited by ASCII NUL characters -j, --workers NUM Use NUM workers for searching. (default is # of CPUs) + -i, --show-info Show selection info line -h, --help Display this help and exit -v, --version Output version information and exit TTY -- cgit v1.2.3