From bcf02a66719b92332422817635171c4c81686b22 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 18 Feb 2013 16:58:07 +0400 Subject: [PATCH] remove remaining uses of deferredCall --- lib/ace/edit_session.js | 3 +-- lib/ace/lib/lang.js | 31 +++---------------------------- lib/ace/split.js | 2 +- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 8f7f1f2b..f61bc15a 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -427,8 +427,7 @@ var EditSession = function(text, mode) { self.$deltas = []; } - this.$informUndoManager = - lang.deferredCall(this.$syncInformUndoManager); + this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); } }; diff --git a/lib/ace/lib/lang.js b/lib/ace/lib/lang.js index 4e6ebf2c..37b880bb 100644 --- a/lib/ace/lib/lang.js +++ b/lib/ace/lib/lang.js @@ -144,34 +144,9 @@ exports.getMatchOffsets = function(string, regExp) { /* deprecated */ exports.deferredCall = function(fcn) { - - var timer = null; - var callback = function() { - timer = null; - fcn(); - }; - - var deferred = function(timeout) { - deferred.cancel(); - timer = setTimeout(callback, timeout || 0); - return deferred; - }; - - deferred.schedule = deferred; - - deferred.call = function() { - this.cancel(); - fcn(); - return deferred; - }; - - deferred.cancel = function() { - clearTimeout(timer); - timer = null; - return deferred; - }; - - return deferred; + if (typeof console != "undefined" && console.error) + console.error("Deprecated: use lang.delayedCall") + return exports.delayedCall(fcn); }; diff --git a/lib/ace/split.js b/lib/ace/split.js index 56f73d4b..878b0dc3 100644 --- a/lib/ace/split.js +++ b/lib/ace/split.js @@ -224,7 +224,7 @@ var Split = function(container, theme, splits) { // Overwrite the default $informUndoManager function such that new delas // aren't added to the undo manager from the new and the old session. - s.$informUndoManager = lang.deferredCall(function() { s.$deltas = []; }); + s.$informUndoManager = lang.delayedCall(function() { s.$deltas = []; }); // Copy over 'settings' from the session. s.setTabSize(session.getTabSize());