diff options
-rw-r--r-- | fzy.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -256,9 +256,6 @@ int main(int argc, char *argv[]) { choices_init(&choices); choices_fread(&choices, stdin); - if (num_lines > choices.size) - num_lines = choices.size; - if (benchmark) { if (!filter) { fprintf(stderr, "Must specify -e/--show-matches with --benchmark\n"); @@ -278,6 +275,9 @@ int main(int argc, char *argv[]) { tty_t tty; tty_init(&tty, tty_filename); + if (num_lines > choices.size) + num_lines = choices.size; + if (num_lines + 1 > tty_getheight(&tty)) num_lines = tty_getheight(&tty) - 1; |