Commit bf645142 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Checking for "nothing to redo" earlier, in order to restore the

possible warning about an internal error.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5380 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 9 additions and 2 deletions
+9 -2
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* src/text.c (add_undo): Only skip adding an undo when the current * src/text.c (add_undo): Only skip adding an undo when the current
action equals the last action. This condition is needed for when action equals the last action. This condition is needed for when
typing text is broken by an undo+redo. Fixes Savannah bug #46323. typing text is broken by an undo+redo. Fixes Savannah bug #46323.
* src/text.c (do_redo): Check for "nothing to redo" earlier, so we
can restore the possible warning about an internal error.
2015-10-29 David Lawrence Ramsey <pooka109@gmail.com> 2015-10-29 David Lawrence Ramsey <pooka109@gmail.com>
* src/files.c (do_writeout), src/nano.c (no_current_file_name_warning, * src/files.c (do_writeout), src/nano.c (no_current_file_name_warning,
......
...@@ -628,12 +628,17 @@ void do_redo(void) ...@@ -628,12 +628,17 @@ void do_redo(void)
char *data, *redidmsg = NULL; char *data, *redidmsg = NULL;
undo *u = openfile->undotop; undo *u = openfile->undotop;
if (u == NULL || u == openfile->current_undo) {
statusbar(_("Nothing to re-do!"));
return;
}
/* Get the previous undo item. */ /* Get the previous undo item. */
while (u != NULL && u->next != openfile->current_undo) while (u != NULL && u->next != openfile->current_undo)
u = u->next; u = u->next;
if (u == NULL) { if (u->next != openfile->current_undo) {
statusbar(_("Nothing to re-do!")); statusbar(_("Internal error: cannot set up redo. Please save your work."));
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment