diff options
Diffstat (limited to 'background_scripts/main.coffee')
| -rw-r--r-- | background_scripts/main.coffee | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 45619023..44644769 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -221,9 +221,13 @@ refreshCompleter = (request) -> completers[request.name].refresh() whitespaceRegexp = /\s+/ filterCompleter = (args, port) -> - queryTerms = if (args.query == "") then [] else args.query.split(whitespaceRegexp) - completers[args.name].filter queryTerms, (results, extra = {}) -> - port.postMessage extend extra, id: args.id, results: results + if args.name? and args.userIsTyping + completers[args.name].userIsTyping?() + + if args.id? and args.name? and args.query? + queryTerms = if (args.query == "") then [] else args.query.split(whitespaceRegexp) + completers[args.name].filter queryTerms, (results, extra = {}) -> + port.postMessage extend extra, id: args.id, results: results chrome.tabs.onSelectionChanged.addListener (tabId, selectionInfo) -> if (selectionChangedHandlers.length > 0) |
