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 = [];
|
self.$deltas = [];
|
||||||
}
|
}
|
||||||
this.$informUndoManager =
|
this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);
|
||||||
lang.deferredCall(this.$syncInformUndoManager);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,34 +144,9 @@ exports.getMatchOffsets = function(string, regExp) {
|
||||||
|
|
||||||
/* deprecated */
|
/* deprecated */
|
||||||
exports.deferredCall = function(fcn) {
|
exports.deferredCall = function(fcn) {
|
||||||
|
if (typeof console != "undefined" && console.error)
|
||||||
var timer = null;
|
console.error("Deprecated: use lang.delayedCall")
|
||||||
var callback = function() {
|
return exports.delayedCall(fcn);
|
||||||
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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ var Split = function(container, theme, splits) {
|
||||||
|
|
||||||
// Overwrite the default $informUndoManager function such that new delas
|
// Overwrite the default $informUndoManager function such that new delas
|
||||||
// aren't added to the undo manager from the new and the old session.
|
// 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.
|
// Copy over 'settings' from the session.
|
||||||
s.setTabSize(session.getTabSize());
|
s.setTabSize(session.getTabSize());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue