diff options
author | anekos | 2011-09-04 20:50:10 +0900 |
---|---|---|
committer | anekos | 2011-09-04 20:50:10 +0900 |
commit | e2dc6195c1599adfba1d1c2927d10940b6ffb3ae (patch) | |
tree | 7df9d281c21d9d47bf8aad9b611aecc468c3b7dc /google-translator.js | |
parent | 5af11a142754ef72cfdbc581d0beabe7884100d0 (diff) | |
download | vimperator-plugins-e2dc6195c1599adfba1d1c2927d10940b6ffb3ae.tar.bz2 |
テキスト補完はオプションに
Diffstat (limited to 'google-translator.js')
-rw-r--r-- | google-translator.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/google-translator.js b/google-translator.js index 0f711a3..cd7204f 100644 --- a/google-translator.js +++ b/google-translator.js @@ -198,11 +198,16 @@ let INFO = ); function textCompleter (context, args) { - context.completions = [ - [it, ''] - for ([, it] in Iterator(getTexts())) + if (!liberator.globalVariables.google_translator_text_completer) + return; + let i = 0, cs = []; + for (let [, it] in Iterator(getTexts())) { + if (++i > 100) + break; if (it.length > 3 && !/^\s*</.test(it)) - ]; + cs.push([it, '']); + } + context.completions = cs; } function guessRequest (text, done) { |