From b50d5758efd5b528b59e6458f41fc676b50c3660 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 3 May 2019 12:52:27 +0200 Subject: [PATCH] zapping: disjoin a zap command from earlier ones when the mark is set This fixes the third part of https://savannah.gnu.org/bugs/?56261. Bug existed since zapping was introduced, in version 3.2. --- src/cut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cut.c b/src/cut.c index 94d6e96c..b4052344 100644 --- a/src/cut.c +++ b/src/cut.c @@ -450,7 +450,7 @@ void zap_text(void) /* Add a new undo item only when the current item is not a ZAP or when * the current zap is not contiguous with the previous zapping. */ - if (openfile->last_action != ZAP || + if (openfile->last_action != ZAP || openfile->mark != NULL || openfile->current_undo->mark_begin_lineno != openfile->current->lineno || openfile->current_undo->xflags & (MARK_WAS_SET|WAS_MARKED_FORWARD)) add_undo(ZAP);