undo: force a screen refresh also for the special case Bsp-at-EOF

Because meanwhile the cursor might be someplace where EOF is offscreen.

This effectively reverts commit 9ccf85ea from two years ago, but also
sets 'focusing' to false so that the last line of the buffer will be at
the bottom of the edit window, where it probably was when Bsp was typed.

This fixes https://savannah.gnu.org/bugs/?65428.
The issue was reported by `correctmost`.

Bug existed since version 6.3, commit 9ccf85ea.
This commit is contained in:
Benno Schulenberg 2024-03-07 17:07:23 +01:00
parent c67ea1ffc1
commit 862574f381
1 changed files with 2 additions and 2 deletions

View File

@ -553,8 +553,8 @@ void do_undo(void)
* and the nonewlines flag isn't set, do not re-add a newline that
* wasn't actually deleted; just position the cursor. */
if ((u->xflags & WAS_BACKSPACE_AT_EOF) && !ISSET(NO_NEWLINES)) {
openfile->current = openfile->filebot;
openfile->current_x = 0;
goto_line_posx(openfile->filebot->lineno, 0);
focusing = FALSE;
break;
}
line->data[u->tail_x] = '\0';