diff options
author | vimboss <devnull@localhost> | 2007-08-05 16:33:12 +0000 |
---|---|---|
committer | vimboss <devnull@localhost> | 2007-08-05 16:33:12 +0000 |
commit | 3aa01b025dcd8baca708d08c7decc3762183071c (patch) | |
tree | 40da44ca98585f01290d2fa9b7b5858448549c1b | |
parent | 74693413ce5a8cd23e3faf4b26e52fc8feed3883 (diff) | |
download | vim-3aa01b025dcd8baca708d08c7decc3762183071c.tar.gz |
-rw-r--r-- | src/spell.c | 15 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/spell.c b/src/spell.c index a4c68117..ce887f74 100644 --- a/src/spell.c +++ b/src/spell.c @@ -12182,7 +12182,9 @@ suggest_trie_walk(su, lp, fword, soundfold) { n = mb_cptr2len(p); c = mb_ptr2char(p); - if (!soundfold && !spell_iswordp(p + n, curbuf)) + if (p[n] == NUL) + c2 = NUL; + else if (!soundfold && !spell_iswordp(p + n, curbuf)) c2 = c; /* don't swap non-word char */ else c2 = mb_ptr2char(p + n); @@ -12190,12 +12192,21 @@ suggest_trie_walk(su, lp, fword, soundfold) else #endif { - if (!soundfold && !spell_iswordp(p + 1, curbuf)) + if (p[1] == NUL) + c2 = NUL; + else if (!soundfold && !spell_iswordp(p + 1, curbuf)) c2 = c; /* don't swap non-word char */ else c2 = p[1]; } + /* When the second character is NUL we can't swap. */ + if (c2 == NUL) + { + sp->ts_state = STATE_REP_INI; + break; + } + /* When characters are identical, swap won't do anything. * Also get here if the second char is not a word character. */ if (c == c2) diff --git a/src/version.c b/src/version.c index 95f2a4fa..a8edba47 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 51, +/**/ 50, /**/ 49, |