Bugfix: Deleting backward selected text was getting stuck on redo.
authorIan Thompson <quornian@googlemail.com>
Wed, 23 Jul 2008 12:59:05 +0000 (12:59 +0000)
committerIan Thompson <quornian@googlemail.com>
Wed, 23 Jul 2008 12:59:05 +0000 (12:59 +0000)
Selections were not correctly preserved through undo/redo operations causing unexpected behaviour.

source/blender/blenkernel/intern/text.c

index 6d5125752445b06d628e19c9b5021ec96e2c7a0e..5c1ec1b40081d7f5b2026f6b3ed3be6c54609b93 100644 (file)
@@ -1821,6 +1821,12 @@ void txt_do_undo(Text *text)
                        
                        break;
        }
+
+       /* next undo step may need evaluating */
+       if (text->undo_pos>=0 && text->undo_buf[text->undo_pos] == UNDO_STO) {
+               txt_do_undo(text);
+               txt_do_redo(text); /* selections need restoring */
+       }
        
        undoing= 0;     
 }
@@ -1895,7 +1901,7 @@ void txt_do_redo(Text *text)
 
                case UNDO_SWAP:
                        txt_curs_swap(text);
-                       txt_do_undo(text); /* swaps should appear transparent a*/
+                       txt_do_redo(text); /* swaps should appear transparent a*/
                        break;
                        
                case UNDO_CTO: