From e96022b92371cfae85352015aa0c8373f2b7b210 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 17 Jun 2014 15:50:34 +0000 Subject: [PATCH] After an undo or redo, update the 'placewewant'. Patch by Mark Majeres. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4976 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/text.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 57911f57..16a83841 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-06-17 Mark Majeres + * src/text.c (do_undo, do_redo): After an undo or redo, update the + 'placewewant' (the desired horizontal position of the cursor). + 2014-06-17 Benno Schulenberg * src/text.c (do_undo, do_redo): Remove obsolete boolean variable. diff --git a/src/text.c b/src/text.c index 404df9e6..e8a97d29 100644 --- a/src/text.c +++ b/src/text.c @@ -558,6 +558,7 @@ void do_undo(void) renumber(f); openfile->current_undo = openfile->current_undo->next; openfile->last_action = OTHER; + openfile->placewewant = xplustabs(); set_modified(); } @@ -611,7 +612,6 @@ void do_redo(void) free(f->data); f->data = data; openfile->current_x = u->begin; - openfile->placewewant = xplustabs(); goto_line_posx(u->lineno, u->begin); break; case ENTER: @@ -674,6 +674,7 @@ void do_redo(void) openfile->current_undo = u; openfile->last_action = OTHER; + openfile->placewewant = xplustabs(); set_modified(); } #endif /* !NANO_TINY */ -- 2.39.5