diff --git a/src/ace/Document.js b/src/ace/Document.js index 2bb17c99..ce196593 100644 --- a/src/ace/Document.js +++ b/src/ace/Document.js @@ -76,11 +76,14 @@ var Document = function(text, mode) { } if (undoManager) { - undoManager.setDocument(this); + //undoManager.setDocument(this); var self = this; this.$informUndoManager = lang.deferredCall(function() { if (self.$deltas.length > 0) - undoManager.notify(self.$deltas); + undoManager.execute({ + action : "aceupdate", + args : [self.$deltas, self] + }); self.$deltas = []; }); } diff --git a/src/ace/UndoManager.js b/src/ace/UndoManager.js index 4133fb8d..6d7d2260 100644 --- a/src/ace/UndoManager.js +++ b/src/ace/UndoManager.js @@ -14,12 +14,14 @@ var UndoManager = function() { (function() { - this.$doc = null; + /*this.$doc = null; this.setDocument = function(doc) { this.$doc = doc; - }; + };*/ - this.notify = function(deltas) { + this.execute = function(options) { + var deltas = options.args[0]; + this.$doc = options.args[1]; this.$undoStack.push(deltas); };