On 9/25/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
Yakov Lerner wrote: > On 9/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> Hello everyone. >> >> The spell-check in Vim7 seems wonderful, several weeks ago I've been >> challenged to do spellcheck for files which contain both English and >> Chinese text. I failed to do that. >> >> The problem is that if the spell-check turned on, ALL chinese text are >> marked as spell error and it might be difficult to see where the real >> spell >> error is. >> >> Chinese text do not need spell check at all since all chinese characters >> are valid words, we do want to check English text only. Note that the >> target file may also be a C program and we may want to spell check the >> comment. >> >> One solution may be add all chinese characters into spell dictionary but >> that seems to be crazy and the dictionary would be huge. >> >> Is it possible to do spell-check only for ascii character and just ignore >> the double-width character? > > One solution, I think, is to prepare the primitive syntaxfile > that matches all Chinese chars with a syntax highlight group > labeled with [EMAIL PROTECTED] Supposedly chinese chars > all have codes above 256 and english chars have codes below that, > or below z. > > Yakov >Problem is, pattern ranges in the form [m-n] are IIUC not applicable to range bounds above 0xFF; so e.g. syntax match CJK /[\u1100-\U2FA1F]/ [EMAIL PROTECTED] contains an invalid range because the bounds are characters >255. The help paragraph - If two characters in the sequence are separated by '-', this is shorthand for the full list of ASCII characters between them. E.g., "[0-9]" matches any decimal digit. is not very clear, but notice the word ASCII. Recently I tried to make a search on a range within the Unicode CJK codepoint range and got an error "E16: Invalid range".
Then the solution is to declare [EMAIL PROTECTED] for english chars [!-~] and @NoSpell for all the rest. Yakov
