statusbar: suppress --constantshow when the terminal has just one row

When there is just one row, the text to be edited needs to be shown
there, not some meta information about the cursor position.

This fixes https://savannah.gnu.org/bugs/?60563.

Bug existed since version 2.7.0, since nano allows very flat terminals.
This commit is contained in:
Benno Schulenberg 2021-05-09 19:11:49 +02:00
parent 07fd4c4598
commit 36ffb5f0ac
2 changed files with 3 additions and 2 deletions

View File

@ -2507,7 +2507,8 @@ int main(int argc, char **argv)
#endif
/* Update the displayed current cursor position only when there
* is no message and no keys are waiting in the input buffer. */
if (ISSET(CONSTANT_SHOW) && lastmessage == VACUUM && get_key_buffer_len() == 0)
if (ISSET(CONSTANT_SHOW) && lastmessage == VACUUM && LINES > 1 &&
get_key_buffer_len() == 0)
report_cursor_position();
as_an_at = TRUE;

View File

@ -1683,7 +1683,7 @@ void check_statusblank(void)
statusblank--;
/* When editing and 'constantshow' is active, skip the blanking. */
if (currmenu == MMAIN && ISSET(CONSTANT_SHOW))
if (currmenu == MMAIN && ISSET(CONSTANT_SHOW) && LINES > 1)
return;
if (statusblank == 0)