summaryrefslogtreecommitdiff
path: root/src/spell.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-08-05 16:33:12 +0000
committerBram Moolenaar <Bram@vim.org>2007-08-05 16:33:12 +0000
commit3dcfbf7c4da5f576671c436bc64ce344a6267f71 (patch)
tree40da44ca98585f01290d2fa9b7b5858448549c1b /src/spell.c
parente7c56869442ff04ca7fcadd807051afe443f38b7 (diff)
downloadvim-git-3dcfbf7c4da5f576671c436bc64ce344a6267f71.tar.gz
updated for version 7.1-051v7.1.051
Diffstat (limited to 'src/spell.c')
-rw-r--r--src/spell.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/spell.c b/src/spell.c
index a4c681172..ce887f749 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)