when trying to undo edits after an indentation change.
This works around Savannah bug #46591.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5474
35c25a1d-7b9e-4130-9fde-
d3aeb78583b8
* src/text.c (do_justify): Discard the entire undo stack, to prevent
nano from dying (or making mistakes) when trying to undo edits after
a justification. This works around Savannah bug #45531.
+ * src/text.c (do_indent): Also here discard the entire undo stack, to
+ prevent nano from making mistakes when trying to undo edits after an
+ indentation change. This works around Savannah bug #46591.
2015-12-02 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/python.nanorc: Don't colour triple quotes by themselves.
free(line_indent);
if (indent_changed) {
+ /* Throw away the undo stack, to prevent making mistakes when
+ * the user tries to undo something in the reindented text. */
+ discard_until(NULL);
+ openfile->current_undo = NULL;
+
/* Mark the file as modified. */
set_modified();