commit 862574f3817abe66a116d3371337f6a3115c2d76
parent c67ea1ffc19ed4578c8476696a7edf8860cb78ba
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 7 Mar 2024 17:07:23 +0100
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.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -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';