summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fzy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fzy.c b/fzy.c
index a84b125..de6535c 100644
--- a/fzy.c
+++ b/fzy.c
@@ -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;