display: show the help lines down to the tiniest possible terminal size

That is: compute the minimum needed terminal height more accurately.
This commit is contained in:
Benno Schulenberg 2023-11-20 16:05:42 +01:00
parent f5bc261944
commit 6a7a0c8f50
2 changed files with 5 additions and 4 deletions

View File

@ -420,8 +420,9 @@ void window_init(void)
midwin = newwin(editwinrows, COLS, 0, 0);
footwin = newwin(1, COLS, LINES - 1, 0);
} else {
int toprows = ((ISSET(EMPTY_LINE) && LINES > 6) ? 2 : 1);
int bottomrows = ((ISSET(NO_HELP) || LINES < 6) ? 1 : 3);
int minimum = (ISSET(ZERO) ? 3 : ISSET(MINIBAR) ? 4 : 5);
int toprows = ((ISSET(EMPTY_LINE) && LINES > minimum) ? 2 : 1);
int bottomrows = ((ISSET(NO_HELP) || LINES < minimum) ? 1 : 3);
if (ISSET(MINIBAR) || ISSET(ZERO))
toprows = 0;
@ -1077,7 +1078,7 @@ void toggle_this(int flag)
draw_all_subwindows();
return;
case NO_HELP:
if (LINES < 6) {
if (LINES < (ISSET(ZERO) ? 3 : ISSET(MINIBAR) ? 4 : 5)) {
statusline(AHEM, _("Too tiny"));
TOGGLE(flag);
return;

View File

@ -2431,7 +2431,7 @@ void bottombars(int menu)
/* Set the global variable to the given menu. */
currmenu = menu;
if (ISSET(NO_HELP) || LINES < 6)
if (ISSET(NO_HELP) || LINES < (ISSET(ZERO) ? 3 : ISSET(MINIBAR) ? 4 : 5))
return;
/* Determine how many shortcuts must be shown. */