nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 36ffb5f0ac6e8eeaa8ab085445d572aa6d87b0ad
parent 07fd4c45988aa4993e1e93a84f317d3b977def7f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun,  9 May 2021 19:11:49 +0200

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.

Diffstat:
Msrc/nano.c | 3++-
Msrc/winio.c | 2+-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -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; diff --git a/src/winio.c b/src/winio.c @@ -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)