rhysd / vim-grammarous

A powerful grammar checker for Vim using LanguageTool.
1.1k stars 41 forks source link

error when spelllang language include cjk #92

Open jdhao opened 3 years ago

jdhao commented 3 years ago

My setting for spelllang:

set spelllang=en,cjk

If add the following setting:

let g:grammarous#use_vim_spelllang = 1

When I run :GrammarousCheck, I will get an error :

|| vim-grammarous: Grammar check failed: java.lang.IllegalArgumentException: 'en,cjk' is not a language code known to LanguageTool. Supported language codes are: ar, ast-ES, be-BY, br-FR, ca-ES, ca-ES-valencia, da-DK, de, de-AT, de-CH, de-DE, de-DE-x-simple-language, el-GR, en, en-AU, en-CA, en-GB, en-NZ, en-US, en-ZA, eo, es, fa, fr, ga-IE, gl-ES, it, ja-JP, km-KH, nl, pl-PL, pt, pt-AO, pt-BR, pt-MZ, pt-PT, ro-RO, ru-RU, sk-SK, sl-SI, sv, ta-IN, tl-PH, uk-UA, zh-CN. The list of languages is read from META-INF/org/languagetool/language-module.properties in the Java classpath. See http://wiki.languagetool.org/java-api for details.

The option string supported by vim and languagetool are not the same, hence the error. Maybe just strip the option string before sending it to languagetool?