undo: restore the cursor position when a cut and paste are paired

When undoing/redoing an alternate spell check (of the entire file
or of a backwards marked region), put the cursor back where it was
when the spell check was invoked/finished.

This fixes https://savannah.gnu.org/bugs/?54466.
master
David Lawrence Ramsey 2018-08-08 19:07:03 -05:00 committed by Benno Schulenberg
parent fd65f74428
commit 07447f3278
1 changed files with 4 additions and 0 deletions

View File

@ -797,6 +797,8 @@ void do_undo(void)
break;
case COUPLE_BEGIN:
undidmsg = u->strdata;
if (u->xflags != MARK_WAS_SET)
goto_line_posx(u->lineno, u->begin);
break;
case COUPLE_END:
openfile->current_undo = openfile->current_undo->next;
@ -965,6 +967,8 @@ void do_redo(void)
openfile->current_undo = u;
do_redo();
do_redo();
if (u->xflags != MARK_WAS_SET)
goto_line_posx(u->lineno, u->begin);
do_redo();
return;
case COUPLE_END: