fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit 617b21e05338290322a08f0daf1e29829dce9556 parent 49f18e80e903578eeddda22584703fac560a8fb4 Author: Mārtiņš Mačs <martins.macs@bi.lv> Date: Wed, 29 Jan 2020 18:17:06 +0200 Fix --show-info when lines do not fit in the screen Diffstat:
| M | src/fzy.c | | | 8 | ++++++-- |
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/fzy.c b/src/fzy.c @@ -53,8 +53,12 @@ int main(int argc, char *argv[]) { if (options.num_lines > choices.size) options.num_lines = choices.size; - if (options.num_lines + 1 > tty_getheight(&tty)) - options.num_lines = tty_getheight(&tty) - 1; + int num_lines_adjustment = 1; + if (options.show_info) + num_lines_adjustment++; + + if (options.num_lines + num_lines_adjustment > tty_getheight(&tty)) + options.num_lines = tty_getheight(&tty) - num_lines_adjustment; tty_interface_t tty_interface; tty_interface_init(&tty_interface, &tty, &choices, &options);