verbatim: with --zero, keep cursor in viewport when it was on bottom row

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

Bug existed since version 6.0, since --zero was introduced.
This commit is contained in:
Benno Schulenberg 2022-04-11 10:24:17 +02:00
parent e67d1bfeb8
commit 42c7bfcf8a

View File

@ -2997,6 +2997,13 @@ void do_verbatim_input(void)
size_t count = 1;
char *bytes;
#ifndef NANO_TINY
/* When barless and with cursor on bottom row, make room for the feedback. */
if (ISSET(ZERO) && openfile->current_y == editwinrows - 1 && LINES > 1) {
edit_scroll(FORWARD);
edit_refresh();
}
#endif
/* TRANSLATORS: Shown when the next keystroke will be inserted verbatim. */
statusline(INFO, _("Verbatim Input"));
place_the_cursor();