| ... | ... |
@@ -109,8 +109,13 @@ static void draw(tty_interface_t *state) {
|
| 109 | 109 |
} |
| 110 | 110 |
} |
| 111 | 111 |
|
| 112 |
- tty_moveup(tty, num_lines + (options->show_info ? 1 : 0)); |
|
| 113 |
- tty_setcol(tty, strlen(options->prompt) + state->cursor); |
|
| 112 |
+ if (num_lines + options->show_info) |
|
| 113 |
+ tty_moveup(tty, num_lines + options->show_info); |
|
| 114 |
+ |
|
| 115 |
+ tty_setcol(tty, 0); |
|
| 116 |
+ fputs(options->prompt, tty->fout); |
|
| 117 |
+ for (size_t i = 0; i < state->cursor; i++) |
|
| 118 |
+ fputc(state->search[i], tty->fout); |
|
| 114 | 119 |
tty_flush(tty); |
| 115 | 120 |
} |
| 116 | 121 |
|
| ... | ... |
@@ -1,3 +1,4 @@ |
| 1 |
+# coding: utf-8 |
|
| 1 | 2 |
require 'minitest' |
| 2 | 3 |
require 'minitest/autorun' |
| 3 | 4 |
require 'ttytest' |
| ... | ... |
@@ -458,6 +459,7 @@ Usage: fzy [OPTION]... |
| 458 | 459 |
-s, --show-scores Show the scores of each match |
| 459 | 460 |
-0, --read-null Read input delimited by ASCII NUL characters |
| 460 | 461 |
-j, --workers NUM Use NUM workers for searching. (default is # of CPUs) |
| 462 |
+ -i, --show-info Show selection info line |
|
| 461 | 463 |
-h, --help Display this help and exit |
| 462 | 464 |
-v, --version Output version information and exit |
| 463 | 465 |
TTY |