refactor(multibyte): eliminate mb_ptr2len alias for utfc_ptr2len

This commit is contained in:
Björn Linse
2021-11-14 12:40:46 +01:00
parent 9f27e6cbe7
commit 0039ba04b0
25 changed files with 65 additions and 66 deletions

View File

@@ -281,7 +281,7 @@ void trans_characters(char_u *buf, int bufsize)
while (*buf != 0) {
// Assume a multi-byte character doesn't need translation.
if ((trs_len = (*mb_ptr2len)(buf)) > 1) {
if ((trs_len = utfc_ptr2len(buf)) > 1) {
len -= trs_len;
} else {
trs = transchar_byte(*buf);
@@ -498,7 +498,7 @@ char_u *str_foldcase(char_u *str, int orglen, char_u *buf, int buflen)
}
// skip to next multi-byte char
i += (*mb_ptr2len)(STR_PTR(i));
i += utfc_ptr2len(STR_PTR(i));
}
@@ -732,7 +732,7 @@ int vim_strnsize(char_u *s, int len)
assert(s != NULL);
int size = 0;
while (*s != NUL && --len >= 0) {
int l = (*mb_ptr2len)(s);
int l = utfc_ptr2len(s);
size += ptr2cells(s);
s += l;
len -= l - 1;