Commit b0a2f985 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Skipping the addition of an undo only when the current action equals the

last action.  Necessary for when typing text is broken by an undo+redo.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5379 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 0d9397e5
Showing with 6 additions and 1 deletion
+6 -1
2015-10-29 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (add_undo): Only skip adding an undo when the current
action equals the last action. This condition is needed for when
typing text is broken by an undo+redo. Fixes Savannah bug #46323.
2015-10-29 David Lawrence Ramsey <pooka109@gmail.com> 2015-10-29 David Lawrence Ramsey <pooka109@gmail.com>
* src/files.c (do_writeout), src/nano.c (no_current_file_name_warning, * src/files.c (do_writeout), src/nano.c (no_current_file_name_warning,
do_exit): When option -t is given, make ^O work the same way as under do_exit): When option -t is given, make ^O work the same way as under
......
...@@ -912,7 +912,7 @@ void add_undo(undo_type action) ...@@ -912,7 +912,7 @@ void add_undo(undo_type action)
/* When doing contiguous adds or contiguous cuts -- which means: with /* When doing contiguous adds or contiguous cuts -- which means: with
* no cursor movement in between -- don't add a new undo item. */ * no cursor movement in between -- don't add a new undo item. */
if (u && u->mark_begin_lineno == fs->current->lineno && if (u && u->mark_begin_lineno == fs->current->lineno && action == fs->last_action &&
((action == ADD && u->type == ADD && u->mark_begin_x == fs->current_x) || ((action == ADD && u->type == ADD && u->mark_begin_x == fs->current_x) ||
(action == CUT && u->type == CUT && !u->mark_set && keeping_cutbuffer()))) (action == CUT && u->type == CUT && !u->mark_set && keeping_cutbuffer())))
return; return;
......
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