diff --git a/ChangeLog b/ChangeLog index 2a0f0adb927d5e5f33df47206ce5cfcad7d228df..bd55f28afa8b9f07b0ba5dc2c7f6d353d110a7ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Rename a variable, for contrast and correctness. * src/cut.c (do_copy_text): Don't move the cursor when copying a backwardly marked region. This fixes Savannah bug #46980. + * src/text.c (do_undo, do_redo): Center the cursor when the + thing being undone or redone is currently off the screen. 2016-02-22 Chris Allegretta <chrisa@asty.org> * Add ability to kill the trailing spaces when justifying diff --git a/src/nano.c b/src/nano.c index 8102d40fc0d5b165be24e29bb5ff803b72e89768..020d3509a1fc602766a848d8fe3d817f1c5a488b 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2657,6 +2657,7 @@ int main(int argc, char **argv) do_cursorpos(TRUE); currmenu = MMAIN; + focusing = FALSE; /* Turn the cursor on when waiting for input. */ curs_set(1); diff --git a/src/text.c b/src/text.c index 362e6bfec1d654b66343328cf8233d7a060067db..ac12f351d9ded174cd1813d4d31008c5ff5780b2 100644 --- a/src/text.c +++ b/src/text.c @@ -606,6 +606,7 @@ void do_undo(void) openfile->placewewant = xplustabs(); openfile->totsize = u->wassize; set_modified(); + focusing = TRUE; } /* Redo the last thing(s) we undid. */ @@ -740,6 +741,7 @@ void do_redo(void) openfile->placewewant = xplustabs(); openfile->totsize = u->newsize; set_modified(); + focusing = TRUE; } #endif /* !NANO_TINY */