+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
/* 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");