remove remaining uses of deferredCall
This commit is contained in:
parent
95257a9be5
commit
bcf02a6671
3 changed files with 5 additions and 31 deletions
|
|
@ -427,8 +427,7 @@ var EditSession = function(text, mode) {
|
|||
|
||||
self.$deltas = [];
|
||||
}
|
||||
this.$informUndoManager =
|
||||
lang.deferredCall(this.$syncInformUndoManager);
|
||||
this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue