From 931bf96c1d0cf7a6e19555d0e1ea4ecf9591a4fa Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 17 Nov 2021 17:09:29 +0100 Subject: [PATCH] display: make sure there are at least as many text lines as help lines It's an editor -- the largest element should be the text to be edited, not some part of the interface. (It would be better if the edit window was always the largest element, larger than or equal to all interface elements combined. But that is something for another time.) --- src/nano.c | 4 ++-- src/winio.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nano.c b/src/nano.c index bf60ad9a..c96eb0ee 100644 --- a/src/nano.c +++ b/src/nano.c @@ -420,8 +420,8 @@ void window_init(void) edit = newwin(editwinrows, COLS, 0, 0); bottomwin = newwin(1, COLS, LINES - 1, 0); } else { - int toprows = ((ISSET(EMPTY_LINE) && LINES > 5) ? 2 : 1); - int bottomrows = ((ISSET(NO_HELP) || LINES < 5) ? 1 : 3); + int toprows = ((ISSET(EMPTY_LINE) && LINES > 6) ? 2 : 1); + int bottomrows = ((ISSET(NO_HELP) || LINES < 6) ? 1 : 3); #ifndef NANO_TINY if (ISSET(MINIBAR) || ISSET(ZERO)) diff --git a/src/winio.c b/src/winio.c index 20646267..58979981 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2391,7 +2391,7 @@ void bottombars(int menu) /* Set the global variable to the given menu. */ currmenu = menu; - if (ISSET(NO_HELP) || LINES < 5) + if (ISSET(NO_HELP) || LINES < 6) return; /* Determine how many shortcuts must be shown. */