diff options
author | teramako | 2013-02-11 22:00:35 +0900 |
---|---|---|
committer | teramako | 2013-02-11 22:00:35 +0900 |
commit | 07c5658c27f5426c0c4ef029ec1b6f2e37d5a95a (patch) | |
tree | 62cd15e56f0b6b19fb688383349e97e5dd977ac5 /lookupDictionary.js | |
parent | fc46c8b8a9418da117183774ccb8298f63cc3be8 (diff) | |
download | vimperator-plugins-07c5658c27f5426c0c4ef029ec1b6f2e37d5a95a.tar.bz2 |
fix completer
Diffstat (limited to 'lookupDictionary.js')
-rw-r--r-- | lookupDictionary.js | 11 |
1 files changed, 6 insertions, 5 deletions
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<max ; ++i) { candidates.push([suggestions[i], 'suggest']); } - if (!spellChecker.check(arg)) { + if (!spellChecker.check(filter)) { candidates.unshift(['', 'not exist']); } - return [0, candidates]; + context.completions = candidates; }, bang: true } |