diff options
author | Ondrej Martinek <omartine@akamai.com> | 2019-03-21 13:47:58 +0000 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2019-12-27 23:17:18 -0800 |
commit | cdafcf05b3a0707f99414dad8cac69d8f87d82f0 (patch) | |
tree | b0d434c64d02c60cbab80e15bea7f66fa28a8404 | |
parent | 07ee5a46d7d4981acdebff00116e5ed5880c0bab (diff) |
fix acceptance tests
-rw-r--r-- | src/tty_interface.c | 9 | ||||
-rw-r--r-- | 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 |