diff options
| -rw-r--r-- | lib/completion.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/completion.js b/lib/completion.js index a00f2dab..bc9b6fc6 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -145,18 +145,20 @@ var completion = (function() { }); /** A fuzzy history completer */ - var FuzzyHistoryCompletionSource = AsyncCompletionSource.extend({ + var FuzzyHistoryCompletionSource = Class.extend({ init: function(maxResults) { - this._super(); + this.asyncCompleter = new AsyncCompletionSource(); this.maxResults = maxResults; }, + filter: function(query, callback) { return this.asyncCompleter.filter(query, callback); }, + refresh: function() { - this.reset(); + this.asyncCompleter.reset(); historyCache.use(function(history) { - this.resultsReady(history.slice(-this.maxResults).map(function(item) { - return this.createInternalMatch("history", item); + this.asyncCompleter.resultsReady(history.slice(-this.maxResults).map(function(item) { + return this.asyncCompleter.createInternalMatch("history", item); }.proxy(this))); }.proxy(this)); } |
