]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.422 v7.2.422
authorBram Moolenaar <Bram@vim.org>
Thu, 13 May 2010 15:46:58 +0000 (17:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 13 May 2010 15:46:58 +0000 (17:46 +0200)
Problem:    May get E763 when using spell dictionaries.
Solution:   Avoid utf-8 case folded character to be truncated to 8 bits and
            differ from latin1. (Dominique Pelle)

src/spell.c
src/version.c

index 98f5e3478ba3be4cb5844a319c94d873d9203a26..47b86ade83730dc0ff0d32dd599c711727bbd455 100644 (file)
@@ -9780,10 +9780,16 @@ init_spell_chartab()
     {
        for (i = 128; i < 256; ++i)
        {
+           int f = utf_fold(i);
+           int u = utf_toupper(i);
+
            spelltab.st_isu[i] = utf_isupper(i);
            spelltab.st_isw[i] = spelltab.st_isu[i] || utf_islower(i);
-           spelltab.st_fold[i] = utf_fold(i);
-           spelltab.st_upper[i] = utf_toupper(i);
+           /* The folded/upper-cased value is different between latin1 and
+            * utf8 for 0xb5, causing E763 for no good reason.  Use the latin1
+            * value for utf-8 to avoid this. */
+           spelltab.st_fold[i] = (f < 256) ? f : i;
+           spelltab.st_upper[i] = (u < 256) ? u : i;
        }
     }
     else
index 1f57dd7f60257b53158f31c68965794d2d1602be..d46f0eb10f909d2396de958f2a9d2e11d1c4cfa9 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    422,
 /**/
     421,
 /**/