diff options
| author | Phil Crosby | 2012-05-04 23:33:00 -0700 |
|---|---|---|
| committer | Phil Crosby | 2012-05-05 18:32:13 -0700 |
| commit | 15730576e5ef75cb1c01a867d7bd414572783604 (patch) | |
| tree | 6039652869ff55d56d1aa9267718c2ca52c24a11 /lib | |
| parent | 681a3012ee17ed876c777d88810c3232d3ed10b3 (diff) | |
| download | vimium-15730576e5ef75cb1c01a867d7bd414572783604.tar.bz2 | |
shorten FuzzyHistoryCompletionSource
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/completion.js | 28 |
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() { |
