aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Crosby2012-05-04 23:33:00 -0700
committerPhil Crosby2012-05-05 18:32:13 -0700
commit15730576e5ef75cb1c01a867d7bd414572783604 (patch)
tree6039652869ff55d56d1aa9267718c2ca52c24a11
parent681a3012ee17ed876c777d88810c3232d3ed10b3 (diff)
downloadvimium-15730576e5ef75cb1c01a867d7bd414572783604.tar.bz2
shorten FuzzyHistoryCompletionSource
-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() {