fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

commit f48679cc4588a903f90f1896a2708e88d0b3df77
parent a73ce3c7d945c166c606fd9f2b4ed1a59ba1c51d
Author: John Hawthorn <john.hawthorn@gmail.com>
Date:   Mon, 16 May 2016 20:08:57 -0700

Group together num_lines logic

Diffstat:
Mfzy.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 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;