nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit b50d5758efd5b528b59e6458f41fc676b50c3660
parent 6c4d0d87f09ecbac5bcd0c2d9f812761e3b5637b
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  3 May 2019 12:52:27 +0200

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.

Diffstat:
Msrc/cut.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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);