diff --git a/package.json b/package.json index 3b04cf0c..95c80dca 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "c9.ide.find": "#989c06e6a7", "c9.ide.find.infiles": "#28b3cfcb47", "c9.ide.find.replace": "#43a6b95e6a", - "c9.ide.run.debug": "#789019f9a7", + "c9.ide.run.debug": "#36245ee2aa", "c9.ide.ace.emmet": "#e5f1a92ac3", "c9.ide.ace.gotoline": "#4d1a93172c", "c9.ide.ace.keymaps": "#2477fd8ac6", diff --git a/plugins/c9.ide.editors/document.js b/plugins/c9.ide.editors/document.js index 25f217ea..a7ec71ab 100644 --- a/plugins/c9.ide.editors/document.js +++ b/plugins/c9.ide.editors/document.js @@ -39,13 +39,16 @@ define(function(require, module, exports) { // Listen to changes and detect when the value of the editor // is different from what is on disk - undoManager.on("change", function(e) { - var c = !undoManager.isAtBookmark(); - if (changed !== c || undoManager.position == -1) { - changed = c; - emit("changed", { changed: c }); - } - }); + function initUndo(){ + undoManager.on("change", function(e) { + var c = !undoManager.isAtBookmark(); + if (changed !== c || undoManager.position == -1) { + changed = c; + emit("changed", { changed: c }); + } + }); + } + initUndo(); /***** Methods *****/ @@ -401,6 +404,11 @@ define(function(require, module, exports) { * @property {UndoManager} undoManager */ get undoManager(){ return undoManager; }, + set undoManager(newUndo){ + undoManager.unload(); + undoManager = newUndo; + initUndo(); + }, _events: [ /**