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.)
master
Benno Schulenberg 2021-11-14 16:28:56 +01:00
parent b92b9e5cac
commit a2a00577cd
1 changed files with 6 additions and 0 deletions

View File

@ -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);
}