Index: trunk/extensions/VisualEditor/modules/es/models/es.SurfaceModel.js |
— | — | @@ -28,6 +28,9 @@ |
29 | 29 | |
30 | 30 | es.SurfaceModel.prototype.purgeHistory = function() { |
31 | 31 | this.selection = null; |
| 32 | + this.smallStack = []; |
| 33 | + this.bigStack = []; |
| 34 | + this.undoIndex = 0; |
32 | 35 | }; |
33 | 36 | |
34 | 37 | /** |
— | — | @@ -87,7 +90,7 @@ |
88 | 91 | * (such as when replacing - delete, then insert) |
89 | 92 | */ |
90 | 93 | es.SurfaceModel.prototype.transact = function( transaction ) { |
91 | | - this.bigStack = this.bigStack.slice( 0, this.bigStack.length - this.undoIndex + 1 ); |
| 94 | + this.bigStack = this.bigStack.slice( 0, this.bigStack.length - this.undoIndex ); |
92 | 95 | this.undoIndex = 0; |
93 | 96 | this.smallStack.push( transaction ); |
94 | 97 | this.doc.commit( transaction ); |