Almost working draft of basic undo coalescence

This commit is contained in:
DanyaPostfactum 2013-06-14 16:36:30 +10:00 • committed by nightwing
commit 277675525b
4 changed files with 64 additions and 4 deletions

View file

@ -63,6 +63,9 @@ var UndoManager = function() {
this.execute = function(options) {
var deltas = options.args[0];
this.$doc = options.args[1];
if (options.merge && this.hasUndo()){
deltas = this.$undoStack.pop().concat(deltas);
}
this.$undoStack.push(deltas);
this.$redoStack = [];