aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/search.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-06 20:52:30 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-06 21:11:38 -0400
commit09232958ff9c7d4737701160549c8d64a0f92856 (patch)
tree44b704107b24cbe6d2777ab5556c98c7d645b45f /src/nvim/search.c
parent8f20c50caa7fa008f5e6257ef0fc43620e3baeb1 (diff)
downloadrneovim-09232958ff9c7d4737701160549c8d64a0f92856.tar.gz
rneovim-09232958ff9c7d4737701160549c8d64a0f92856.tar.bz2
rneovim-09232958ff9c7d4737701160549c8d64a0f92856.zip
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. https://github.com/vim/vim/commit/1614a14901558ca091329315d14a7d5e1b53aa47
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r--src/nvim/search.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 85c0d7eb48..1f382d31c5 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -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();