nano

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

commit fb4bcd8cfd17e88da4a72b807a83b2fc5304907a
parent 2288abcd4905c4eb9a65953d682e37e729c8974a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  5 Mar 2020 12:29:22 +0100

undo: store the cursor row, for redoing filtering & justification better

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

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

diff --git a/src/text.c b/src/text.c @@ -620,6 +620,8 @@ void do_undo(void) adjust_viewport(STATIONARY); break; case COUPLE_END: + /* Remember the row of the cursor for a possible redo. */ + openfile->current_undo->head_lineno = openfile->current_y; openfile->current_undo = openfile->current_undo->next; do_undo(); do_undo(); @@ -780,6 +782,7 @@ void do_redo(void) case COUPLE_END: redidmsg = u->strdata; goto_line_posx(u->tail_lineno, u->tail_x); + openfile->current_y = u->head_lineno; adjust_viewport(STATIONARY); break; case INDENT: