From 8d87410c9469f01347fba5c4f4b102f912705612 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 27 Feb 2020 12:03:02 +0100 Subject: [PATCH] tweaks: rearrange a case item, so that PASTE is always after CUT Also, for a REPLACE, the 'head' point does not need to be updated, because a replacement does not change the cursor position. --- src/text.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/text.c b/src/text.c index edaaaa2a..0ea0f1b8 100644 --- a/src/text.c +++ b/src/text.c @@ -1325,9 +1325,6 @@ void update_undo(undo_type action) case JOIN: break; case REPLACE: - case PASTE: - u->head_lineno = openfile->current->lineno; - u->head_x = openfile->current_x; break; #ifdef ENABLE_WRAPPING case SPLIT_BEGIN: @@ -1379,6 +1376,10 @@ void update_undo(undo_type action) u->head_x = strlen(bottomline->data); } break; + case PASTE: + u->head_lineno = openfile->current->lineno; + u->head_x = openfile->current_x; + break; case INSERT: u->tail_lineno = openfile->current->lineno; u->tail_x = openfile->current_x;