From 07c5658c27f5426c0c4ef029ec1b6f2e37d5a95a Mon Sep 17 00:00:00 2001 From: teramako Date: Mon, 11 Feb 2013 22:00:35 +0900 Subject: fix completer --- lookupDictionary.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lookupDictionary.js') diff --git a/lookupDictionary.js b/lookupDictionary.js index 67b8cef..72a31e8 100644 --- a/lookupDictionary.js +++ b/lookupDictionary.js @@ -179,22 +179,23 @@ SITE_DEFINITION.forEach(function (dictionary) { }, dictionary.srcEncode ? dictionary.srcEncode : null); }, { - completer: function (arg) { + completer: function (context, args) { if (!spellChecker || !dictionary.dictionary || !spellChecker.setDictionary(dictionary.dictionary)) - return [0, []]; + return; - var suggestions = spellChecker.suggest(arg); + var filter = context.filter; + var suggestions = spellChecker.suggest(filter); var candidates = []; for (let i=0, max=suggestions.length ; i