From a2a00577cd151a05efc064410e06c21797422a1b Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 14 Nov 2021 16:28:56 +0100 Subject: [PATCH] search: with --zero, do not obscure an occurrence on the bottom row If there is a status-bar message and the cursor happens to be on the bottom row of the screen (in hidden-interface mode), then scroll the viewport one row down, to keep the cursor in view. This addresses the second issue mentioned in commit 03637030. (The issue was rereported in https://savannah.gnu.org/bugs/?61464.) --- src/nano.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nano.c b/src/nano.c index e5a98121..bba7142c 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2545,9 +2545,15 @@ int main(int argc, char **argv) if (refresh_needed && (LINES > 1 || lastmessage == VACUUM)) edit_refresh(); + else + place_the_cursor(); /* When there are no bars, redraw a relevant status message. */ if (ISSET(ZERO) && lastmessage > HUSH) { + if (openfile->current_y == editwinrows - 1 && LINES > 1) { + edit_scroll(FORWARD); + edit_refresh(); + } redrawwin(bottomwin); wnoutrefresh(bottomwin); }