aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPhil Crosby2012-05-05 00:09:14 -0700
committerPhil Crosby2012-05-05 18:32:13 -0700
commit3a0f19dc531c2a5fafc02f1e4f97cab5517c93bf (patch)
tree873668084679b5f991f78e759dfbc303b4735a94 /lib
parent9f3cfbe69d591d5aea9fc3aef34fc7f1d25eddbf (diff)
downloadvimium-3a0f19dc531c2a5fafc02f1e4f97cab5517c93bf.tar.bz2
less inheritence
Diffstat (limited to 'lib')
-rw-r--r--lib/completion.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/completion.js b/lib/completion.js
index bc9b6fc6..240468cb 100644
--- a/lib/completion.js
+++ b/lib/completion.js
@@ -165,12 +165,16 @@ var completion = (function() {
});
/** A fuzzy tab completer */
- var FuzzyTabCompletionSource = AsyncCompletionSource.extend({
+ var FuzzyTabCompletionSource = Class.extend({
+ init: function() { this.asyncCompleter = new AsyncCompletionSource(); },
+
+ filter: function(query, callback) { return this.asyncCompleter.filter(query, callback); },
+
refresh: function() {
- this.reset();
+ this.asyncCompleter.reset();
chrome.tabs.getAllInWindow(null, function(tabs) {
- this.resultsReady(tabs.map(function(tab) {
- return this.createInternalMatch("tab", tab,
+ this.asyncCompleter.resultsReady(tabs.map(function(tab) {
+ return this.asyncCompleter.createInternalMatch("tab", tab,
{ func: "completion.createActionSwitchToTab", args: [tab.id] });
}.proxy(this)));
}.proxy(this));