vim-patch:8.1.2120: some MB_ macros are more complicated than necessary

Problem:    Some MB_ macros are more complicated than necessary. (Dominique
            Pelle)
Solution:   Simplify the macros.  Expand inline.
1614a14901
This commit is contained in:
Jan Edmund Lazo
2019-10-06 20:52:30 -04:00
parent 8f20c50caa
commit 09232958ff
12 changed files with 53 additions and 53 deletions

View File

@@ -681,7 +681,7 @@ int searchit(
}
if (matchcol == matchpos.col && ptr[matchcol] != NUL) {
matchcol += MB_PTR2LEN(ptr + matchcol);
matchcol += utfc_ptr2len(ptr + matchcol);
}
if (matchcol == 0 && (options & SEARCH_START)) {
@@ -1755,7 +1755,7 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
find_mps_values(&initc, &findc, &backwards, FALSE);
if (findc)
break;
pos.col += MB_PTR2LEN(linep + pos.col);
pos.col += utfc_ptr2len(linep + pos.col);
}
if (!findc) {
/* no brace in the line, maybe use " #if" then */
@@ -2234,14 +2234,14 @@ showmatch(
for (p = curbuf->b_p_mps; *p != NUL; ++p) {
if (PTR2CHAR(p) == c && (curwin->w_p_rl ^ p_ri))
break;
p += MB_PTR2LEN(p) + 1;
if (PTR2CHAR(p) == c
&& !(curwin->w_p_rl ^ p_ri)
)
p += utfc_ptr2len(p) + 1;
if (PTR2CHAR(p) == c && !(curwin->w_p_rl ^ p_ri)) {
break;
p += MB_PTR2LEN(p);
if (*p == NUL)
}
p += utfc_ptr2len(p);
if (*p == NUL) {
return;
}
}
if ((lpos = findmatch(NULL, NUL)) == NULL) { // no match, so beep
@@ -4845,7 +4845,7 @@ exit_matched:
&& action == ACTION_EXPAND
&& !(compl_cont_status & CONT_SOL)
&& *startp != NUL
&& *(p = startp + MB_PTR2LEN(startp)) != NUL)
&& *(p = startp + utfc_ptr2len(startp)) != NUL)
goto search_line;
}
line_breakcheck();