summaryrefslogtreecommitdiff
path: root/src/spell.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-29 17:30:27 +0200
committerBram Moolenaar <Bram@vim.org>2017-03-29 17:30:27 +0200
commitace95989ed81929a84e205b26d0972cb9d6b4b19 (patch)
treee6d6813abe2e2671741c7ca27864d85969ec601b /src/spell.c
parent0c078fc7db2902d4ccba04506db082ddbef45a8c (diff)
downloadvim-git-ace95989ed81929a84e205b26d0972cb9d6b4b19.tar.gz
patch 8.0.0520: using a function pointer while the function is knownv8.0.0520
Problem: Using a function pointer instead of the actual function, which we know. Solution: Change mb_ functions to utf_ functions when already checked for Unicode. (Dominique Pelle, closes #1582)
Diffstat (limited to 'src/spell.c')
-rw-r--r--src/spell.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/spell.c b/src/spell.c
index 1700bba0e..ed0db8c8a 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -1208,7 +1208,7 @@ can_compound(slang_T *slang, char_u *word, char_u *flags)
/* Need to convert the single byte flags to utf8 characters. */
p = uflags;
for (i = 0; flags[i] != NUL; ++i)
- p += mb_char2bytes(flags[i], p);
+ p += utf_char2bytes(flags[i], p);
*p = NUL;
p = uflags;
}
@@ -5117,11 +5117,11 @@ suggest_trie_walk(
* SCORE_SUBCOMP. */
if (enc_utf8
&& utf_iscomposing(
- mb_ptr2char(tword
+ utf_ptr2char(tword
+ sp->ts_twordlen
- sp->ts_tcharlen))
&& utf_iscomposing(
- mb_ptr2char(fword
+ utf_ptr2char(fword
+ sp->ts_fcharstart)))
sp->ts_score -=
SCORE_SUBST - SCORE_SUBCOMP;