tweaks: add some "fall-through" comments, and reshuffle some breaks

master
Benno Schulenberg 2019-10-11 17:55:46 +02:00
parent 2656f543f4
commit f551c07e7a
1 changed files with 6 additions and 2 deletions

View File

@ -609,6 +609,7 @@ void do_undo(void)
while (openfile->current_undo->type != SPLIT_BEGIN) while (openfile->current_undo->type != SPLIT_BEGIN)
do_undo(); do_undo();
u = openfile->current_undo; u = openfile->current_undo;
/* Fall-through. */
case SPLIT_BEGIN: case SPLIT_BEGIN:
undidmsg = _("addition"); undidmsg = _("addition");
break; break;
@ -775,6 +776,7 @@ void do_redo(void)
do_redo(); do_redo();
u = openfile->current_undo; u = openfile->current_undo;
goto_line_posx(u->lineno, u->begin); goto_line_posx(u->lineno, u->begin);
/* Fall-through. */
case SPLIT_END: case SPLIT_END:
redidmsg = _("addition"); redidmsg = _("addition");
break; break;
@ -1170,6 +1172,7 @@ void add_undo(undo_type action, const char *message)
if (openfile->current->next == openfile->filebot && if (openfile->current->next == openfile->filebot &&
openfile->current->data[0] != '\0') openfile->current->data[0] != '\0')
u->xflags |= WAS_FINAL_BACKSPACE; u->xflags |= WAS_FINAL_BACKSPACE;
/* Fall-through. */
case DEL: case DEL:
/* When not at the end of a line, store the deleted character, /* When not at the end of a line, store the deleted character,
* else purposely fall into the line-joining code. */ * else purposely fall into the line-joining code. */
@ -1183,6 +1186,7 @@ void add_undo(undo_type action, const char *message)
u->mark_begin_x += charlen; u->mark_begin_x += charlen;
break; break;
} }
/* Fall-through. */
case JOIN: case JOIN:
if (openfile->current->next) { if (openfile->current->next) {
if (u->type == BACK) { if (u->type == BACK) {
@ -1229,16 +1233,15 @@ void add_undo(undo_type action, const char *message)
break; break;
case COUPLE_BEGIN: case COUPLE_BEGIN:
u->mark_begin_lineno = openfile->current_y; u->mark_begin_lineno = openfile->current_y;
/* Fall-through. */
case COUPLE_END: case COUPLE_END:
u->strdata = copy_of(_(message)); u->strdata = copy_of(_(message));
break; break;
case INDENT: case INDENT:
case UNINDENT: case UNINDENT:
break;
#ifdef ENABLE_COMMENT #ifdef ENABLE_COMMENT
case COMMENT: case COMMENT:
case UNCOMMENT: case UNCOMMENT:
break;
#endif #endif
default: default:
break; break;
@ -1388,6 +1391,7 @@ void update_undo(undo_type action)
case INSERT: case INSERT:
u->mark_begin_lineno = openfile->current->lineno; u->mark_begin_lineno = openfile->current->lineno;
u->mark_begin_x = openfile->current_x; u->mark_begin_x = openfile->current_x;
break;
case COUPLE_BEGIN: case COUPLE_BEGIN:
break; break;
case COUPLE_END: case COUPLE_END: