Small fix for debugger. Add ability to set undo manager for document

pull/39/head^2
Ruben Daniels 2015-02-26 18:59:58 +00:00
rodzic 325c9ae0ea
commit bbf2cdb3c1
2 zmienionych plików z 16 dodań i 8 usunięć

Wyświetl plik

@ -65,7 +65,7 @@
"c9.ide.find": "#989c06e6a7", "c9.ide.find": "#989c06e6a7",
"c9.ide.find.infiles": "#28b3cfcb47", "c9.ide.find.infiles": "#28b3cfcb47",
"c9.ide.find.replace": "#43a6b95e6a", "c9.ide.find.replace": "#43a6b95e6a",
"c9.ide.run.debug": "#0c1f549611", "c9.ide.run.debug": "#36245ee2aa",
"c9.ide.ace.emmet": "#e5f1a92ac3", "c9.ide.ace.emmet": "#e5f1a92ac3",
"c9.ide.ace.gotoline": "#4d1a93172c", "c9.ide.ace.gotoline": "#4d1a93172c",
"c9.ide.ace.keymaps": "#1e42293fb9", "c9.ide.ace.keymaps": "#1e42293fb9",

Wyświetl plik

@ -39,13 +39,16 @@ define(function(require, module, exports) {
// Listen to changes and detect when the value of the editor // Listen to changes and detect when the value of the editor
// is different from what is on disk // is different from what is on disk
undoManager.on("change", function(e) { function initUndo(){
var c = !undoManager.isAtBookmark(); undoManager.on("change", function(e) {
if (changed !== c || undoManager.position == -1) { var c = !undoManager.isAtBookmark();
changed = c; if (changed !== c || undoManager.position == -1) {
emit("changed", { changed: c }); changed = c;
} emit("changed", { changed: c });
}); }
});
}
initUndo();
/***** Methods *****/ /***** Methods *****/
@ -401,6 +404,11 @@ define(function(require, module, exports) {
* @property {UndoManager} undoManager * @property {UndoManager} undoManager
*/ */
get undoManager(){ return undoManager; }, get undoManager(){ return undoManager; },
set undoManager(newUndo){
undoManager.unload();
undoManager = newUndo;
initUndo();
},
_events: [ _events: [
/** /**