Mercurial > vim
diff src/search.c @ 18251:c8a53c0daeed v8.1.2120
patch 8.1.2120: some MB_ macros are more complicated than necessary
Commit: https://github.com/vim/vim/commit/1614a14901558ca091329315d14a7d5e1b53aa47
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 6 22:00:13 2019 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Oct 2019 22:15:04 +0200 |
parents | e0ec4cd7a865 |
children | a5de1d88590d |
line wrap: on
line diff
--- a/src/search.c +++ b/src/search.c @@ -2078,7 +2078,7 @@ findmatchlimit( find_mps_values(&initc, &findc, &backwards, FALSE); if (findc) break; - pos.col += MB_PTR2LEN(linep + pos.col); + pos.col += mb_ptr2len(linep + pos.col); } if (!findc) { @@ -2657,14 +2657,14 @@ showmatch( if (PTR2CHAR(p) == c && (curwin->w_p_rl ^ p_ri)) break; #endif - p += MB_PTR2LEN(p) + 1; + p += mb_ptr2len(p) + 1; if (PTR2CHAR(p) == c #ifdef FEAT_RIGHTLEFT && !(curwin->w_p_rl ^ p_ri) #endif ) break; - p += MB_PTR2LEN(p); + p += mb_ptr2len(p); if (*p == NUL) return; } @@ -5633,7 +5633,7 @@ exit_matched: && action == ACTION_EXPAND && !(compl_cont_status & CONT_SOL) && *startp != NUL - && *(p = startp + MB_PTR2LEN(startp)) != NUL) + && *(p = startp + mb_ptr2len(startp)) != NUL) goto search_line; } line_breakcheck();