Commit 530c7862 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Handling more internal errors, and doing it correctly: showing it

directly on the statusbar instead of as an undid or redid message.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5442 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent b255b01b
Showing with 8 additions and 4 deletions
+8 -4
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
occur, instead of silently continuing. occur, instead of silently continuing.
* src/text.c (do_undo): Elide an unneeded variable, and don't skip * src/text.c (do_undo): Elide an unneeded variable, and don't skip
the end of this function when things went wrong. 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> 2015-11-24 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/makefile.nanorc: Also recognize the extensions .make and * doc/syntax/makefile.nanorc: Also recognize the extensions .make and
......
...@@ -605,7 +605,7 @@ void do_undo(void) ...@@ -605,7 +605,7 @@ void do_undo(void)
f->data = data; f->data = data;
break; break;
default: default:
undidmsg = _("Internal error: unknown type. Please save your work."); statusbar(_("Internal error: unknown type. Please save your work."));
break; break;
} }
...@@ -735,7 +735,7 @@ void do_redo(void) ...@@ -735,7 +735,7 @@ void do_redo(void)
u->cutbuffer = NULL; u->cutbuffer = NULL;
break; break;
default: default:
redidmsg = _("Internal error: unknown type. Please save your work."); statusbar(_("Internal error: unknown type. Please save your work."));
break; break;
} }
...@@ -1021,7 +1021,7 @@ void add_undo(undo_type action) ...@@ -1021,7 +1021,7 @@ void add_undo(undo_type action)
break; break;
case ENTER: case ENTER:
break; break;
case OTHER: default:
statusbar(_("Internal error: unknown type. Please save your work.")); statusbar(_("Internal error: unknown type. Please save your work."));
break; break;
} }
...@@ -1160,7 +1160,9 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf ...@@ -1160,7 +1160,9 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf
#endif #endif
case JOIN: case JOIN:
/* These cases are handled by the earlier check for a new line and action. */ /* 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; break;
} }
......
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