]> git.wh0rd.org Git - nano.git/commitdiff
Restoring the cursor position differently, using a more basic routine.
authorBenno Schulenberg <bensberg@justemail.net>
Thu, 31 Dec 2015 16:44:32 +0000 (16:44 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Thu, 31 Dec 2015 16:44:32 +0000 (16:44 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5516 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/text.c

index b3d9ac251ec6505613b1cf54dad021b8b14ede63..e42bf80eaedae859fa7ed3d3af1b6aa4160e779d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2015-12-31  Benno Schulenberg  <bensberg@justemail.net>
+       * src/text.c (do_formatter): Restore the cursor position differently.
+
 2015-12-30  Benno Schulenberg  <bensberg@justemail.net>
        * src/nano.c (main), src/files.c (open_buffer): Don't try to position
        the cursor when opening a buffer failed (because the user specified a
index 9e4dcb261f8ec2be11626bb0a62a8fc78d17843f..c196a93a9087b3f2d3167fdf0993f046292c048e 100644 (file)
@@ -3330,8 +3330,12 @@ void do_formatter(void)
        /* Replace the text of the current buffer with the formatted text. */
        replace_buffer(temp);
 
-       /* Go back to the old position, and mark the file as modified. */
-       do_gotopos(lineno_save, current_x_save, current_y_save, pww_save);
+       /* Restore the cursor position, and mark the file as modified. */
+       goto_line_posx(lineno_save, current_x_save);
+       openfile->current_y = current_y_save;
+       openfile->placewewant = pww_save;
+       edit_update(NONE);
+
        set_modified();
 
        finalstatus = _("Finished formatting");