diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2016-05-16 20:08:57 -0700 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2016-05-16 20:10:12 -0700 |
commit | 73db8f84d662df8628d53a0dc881675a926d2b83 (patch) | |
tree | ad1d129f25ff1535d16fb20a669f680ade5cf16d | |
parent | abe4d5c15876f7e0cb89524a3b2dc0d502f27b38 (diff) |
Group together num_lines logic
-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; |