Commit 4bc8ff1e authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Discarding 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.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5474 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 8 additions and 0 deletions
+8 -0
......@@ -4,6 +4,9 @@
* 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.
......
......@@ -394,6 +394,11 @@ void do_indent(ssize_t cols)
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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment