commit 6a88fe8807fa3c3fdf0189f9c28d0bbba00147bb parent 90f6f25e31cafe9704707b1bb7d3b63e8789ef6f Author: Benno Schulenberg <bensberg@telfort.nl> Date: Fri, 1 Jan 2021 20:24:55 +0100 tweaks: fold two similar and three identical cases together Diffstat:
M | src/text.c | | | 14 | +++----------- |
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/src/text.c b/src/text.c @@ -1077,9 +1077,7 @@ void add_undo(undo_type action, const char *message) break; case PASTE: u->cutbuffer = copy_buffer(cutbuffer); - if (thisline == openfile->filebot) - u->xflags |= INCLUDED_LAST_LINE; - break; + /* Fall-through. */ case INSERT: if (thisline == openfile->filebot) u->xflags |= INCLUDED_LAST_LINE; @@ -1219,17 +1217,11 @@ void update_undo(undo_type action) u->tail_x = strlen(bottomline->data); } break; - case PASTE: - u->tail_lineno = openfile->current->lineno; - u->tail_x = openfile->current_x; - break; - case INSERT: - u->tail_lineno = openfile->current->lineno; - u->tail_x = openfile->current_x; - break; case COUPLE_BEGIN: break; case COUPLE_END: + case PASTE: + case INSERT: u->tail_lineno = openfile->current->lineno; u->tail_x = openfile->current_x; break;