aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/completion.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/completion.js b/lib/completion.js
index 13be5551..103131dd 100644
--- a/lib/completion.js
+++ b/lib/completion.js
@@ -140,22 +140,22 @@ var completion = (function() {
});
/** A fuzzy history completer */
- var FuzzyHistoryCompletionSource = function(maxResults) {
- AsyncCompletionSource.call(this);
- this.maxResults = maxResults;
- }
- utils.extend(AsyncCompletionSource, FuzzyHistoryCompletionSource);
+ var FuzzyHistoryCompletionSource = AsyncCompletionSource.extend({
+ init: function(maxResults) {
+ this._super();
+ this.maxResults = maxResults;
+ },
- FuzzyHistoryCompletionSource.prototype.refresh = function() {
- var self = this;
- self.reset();
+ refresh: function() {
+ this.reset();
- historyCache.use(function(history) {
- self.resultsReady(history.slice(-self.maxResults).map(function(item) {
- return self.createInternalMatch('history', item);
- }))
- });
- }
+ historyCache.use(function(history) {
+ this.resultsReady(history.slice(-this.maxResults).map(function(item) {
+ return this.createInternalMatch("history", item);
+ }.proxy(this)));
+ }.proxy(this));
+ }
+ });
/** A fuzzy tab completer */
var FuzzyTabCompletionSource = function() {