diff options
author | Bram Moolenaar <bram@zimbu.org> | 2010-05-13 17:46:58 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@zimbu.org> | 2010-05-13 17:46:58 +0200 |
commit | 4b8bac8e799d99173fb69a3f292183db25db2415 (patch) | |
tree | 499183293012ed72e35604f194ce5c7a94fbbc78 | |
parent | 4f3aecacf5f0a3ffbc6de80010c96efe048ec528 (diff) | |
download | vim-4b8bac8e799d99173fb69a3f292183db25db2415.tar.gz |
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)
-rw-r--r-- | src/spell.c | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/spell.c b/src/spell.c index 98f5e347..47b86ade 100644 --- a/src/spell.c +++ b/src/spell.c @@ -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 diff --git a/src/version.c b/src/version.c index 1f57dd7f..d46f0eb1 100644 --- a/src/version.c +++ b/src/version.c @@ -682,6 +682,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 422, +/**/ 421, /**/ 420, |