diff options
Diffstat (limited to 'lib/completion.js')
| -rw-r--r-- | lib/completion.js | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/completion.js b/lib/completion.js index 103131dd..1f7aa2b8 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -158,23 +158,17 @@ var completion = (function() { }); /** A fuzzy tab completer */ - var FuzzyTabCompletionSource = function() { - AsyncCompletionSource.call(this); - } - utils.extend(AsyncCompletionSource, FuzzyTabCompletionSource); - - FuzzyTabCompletionSource.prototype.refresh = function() { - var self = this; - self.reset(); - - chrome.tabs.getAllInWindow(null, function(tabs) { - self.resultsReady(tabs.map(function(tab) { - return self.createInternalMatch('tab', tab, - { func: 'completion.createActionSwitchToTab', - args: [tab.id] }); - })); - }); - } + var FuzzyTabCompletionSource = AsyncCompletionSource.extend({ + refresh: function() { + this.reset(); + chrome.tabs.getAllInWindow(null, function(tabs) { + this.resultsReady(tabs.map(function(tab) { + return this.createInternalMatch("tab", tab, + { func: "completion.createActionSwitchToTab", args: [tab.id] }); + }.proxy(this))); + }.proxy(this)); + } + }); /* * A completer which matches only domains from sites in your history with the current query. |
