From fb4bcd8cfd17e88da4a72b807a83b2fc5304907a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 5 Mar 2020 12:29:22 +0100 Subject: [PATCH] undo: store the cursor row, for redoing filtering & justification better This fixes https://savannah.gnu.org/bugs/?57958. --- src/text.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/text.c b/src/text.c index 0f6bb2cc..8d9e418d 100644 --- a/src/text.c +++ b/src/text.c @@ -620,6 +620,8 @@ void do_undo(void) adjust_viewport(STATIONARY); break; case COUPLE_END: + /* Remember the row of the cursor for a possible redo. */ + openfile->current_undo->head_lineno = openfile->current_y; openfile->current_undo = openfile->current_undo->next; do_undo(); do_undo(); @@ -780,6 +782,7 @@ void do_redo(void) case COUPLE_END: redidmsg = u->strdata; goto_line_posx(u->tail_lineno, u->tail_x); + openfile->current_y = u->head_lineno; adjust_viewport(STATIONARY); break; case INDENT: