nano

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

commit 07447f327873bf2fb684844902c33670ab962744
parent fd65f7442868811e016b6aa90f92c87f1d139984
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Wed,  8 Aug 2018 19:07:03 -0500

undo: restore the cursor position when a cut and paste are paired

When undoing/redoing an alternate spell check (of the entire file
or of a backwards marked region), put the cursor back where it was
when the spell check was invoked/finished.

This fixes https://savannah.gnu.org/bugs/?54466.

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

diff --git a/src/text.c b/src/text.c @@ -797,6 +797,8 @@ void do_undo(void) break; case COUPLE_BEGIN: undidmsg = u->strdata; + if (u->xflags != MARK_WAS_SET) + goto_line_posx(u->lineno, u->begin); break; case COUPLE_END: openfile->current_undo = openfile->current_undo->next; @@ -965,6 +967,8 @@ void do_redo(void) openfile->current_undo = u; do_redo(); do_redo(); + if (u->xflags != MARK_WAS_SET) + goto_line_posx(u->lineno, u->begin); do_redo(); return; case COUPLE_END: