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.
master
Benno Schulenberg 2019-05-03 12:52:27 +02:00
parent 6c4d0d87f0
commit b50d5758ef
1 changed files with 1 additions and 1 deletions

View File

@ -450,7 +450,7 @@ void zap_text(void)
/* Add a new undo item only when the current item is not a ZAP or when /* 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. */ * 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->mark_begin_lineno != openfile->current->lineno ||
openfile->current_undo->xflags & (MARK_WAS_SET|WAS_MARKED_FORWARD)) openfile->current_undo->xflags & (MARK_WAS_SET|WAS_MARKED_FORWARD))
add_undo(ZAP); add_undo(ZAP);