nano

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

commit 8d87410c9469f01347fba5c4f4b102f912705612
parent 1961c052c85394d1dfb5d2d98d31f154757c8d08
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 27 Feb 2020 12:03:02 +0100

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.

Diffstat:
Msrc/text.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

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