diff --git a/ChangeLog b/ChangeLog index 493ce6a23d6970c97c8a5e81cdc7c3e843b1488a..7a38ada6d4a83330bb918babfb2fb07ecb8479d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ occur, instead of silently continuing. * src/text.c (do_undo): Elide an unneeded variable, and don't skip the end of this function when things went wrong. + * src/text.c (do_undo, do_redo, add_undo, update_undo): Handle more + possible internal errors, and do it correctly. 2015-11-24 Benno Schulenberg <bensberg@justemail.net> * doc/syntax/makefile.nanorc: Also recognize the extensions .make and diff --git a/src/text.c b/src/text.c index fb8631499c050fdf27d2479e7834c52896331941..3e6e75cfaeffe85a8a081126e2fd05d88b30da78 100644 --- a/src/text.c +++ b/src/text.c @@ -605,7 +605,7 @@ void do_undo(void) f->data = data; break; default: - undidmsg = _("Internal error: unknown type. Please save your work."); + statusbar(_("Internal error: unknown type. Please save your work.")); break; } @@ -735,7 +735,7 @@ void do_redo(void) u->cutbuffer = NULL; break; default: - redidmsg = _("Internal error: unknown type. Please save your work."); + statusbar(_("Internal error: unknown type. Please save your work.")); break; } @@ -1021,7 +1021,7 @@ void add_undo(undo_type action) break; case ENTER: break; - case OTHER: + default: statusbar(_("Internal error: unknown type. Please save your work.")); break; } @@ -1160,7 +1160,9 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf #endif case JOIN: /* These cases are handled by the earlier check for a new line and action. */ - case OTHER: + break; + default: + statusbar(_("Internal error: unknown type. Please save your work.")); break; }