diff options
author | John Hawthorn <john@hawthorn.email> | 2020-01-29 10:49:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-29 10:49:36 -0800 |
commit | c2d816d9e31cf9e2ebaf2b51b346ab2a992d7457 (patch) | |
tree | 9d5aca88f9d0702b975374a2aa7581615542b639 | |
parent | 28195b3a709995354b6c33cec9bb7c9f81532eb6 (diff) | |
parent | b2d5381ab4992fd58e1bf59082edc714341b3a54 (diff) |
Merge pull request #138 from mmartin/master
Fix --show-info when lines do not fit in the screen
-rw-r--r-- | src/fzy.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); |