From: Benno Schulenberg Date: Tue, 23 Feb 2016 12:18:10 +0000 (+0000) Subject: Centering the cursor when the thing being undone or redone is currently X-Git-Tag: v2.5.3~8 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a9a32d6d89f1d9c6bb3a3abe44b518a4bb263719;p=nano.git Centering the cursor when the thing being undone or redone is currently off the screen. See https://lists.gnu.org/archive/html/nano-devel/2016-02/msg00104.html. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5672 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 2a0f0adb..bd55f28a 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 * Add ability to kill the trailing spaces when justifying diff --git a/src/nano.c b/src/nano.c index 8102d40f..020d3509 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 362e6bfe..ac12f351 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 */