comparison 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
comparison
equal deleted inserted replaced
18250:f1d9d3f76c98 18251:c8a53c0daeed
2076 break; 2076 break;
2077 2077
2078 find_mps_values(&initc, &findc, &backwards, FALSE); 2078 find_mps_values(&initc, &findc, &backwards, FALSE);
2079 if (findc) 2079 if (findc)
2080 break; 2080 break;
2081 pos.col += MB_PTR2LEN(linep + pos.col); 2081 pos.col += mb_ptr2len(linep + pos.col);
2082 } 2082 }
2083 if (!findc) 2083 if (!findc)
2084 { 2084 {
2085 /* no brace in the line, maybe use " #if" then */ 2085 /* no brace in the line, maybe use " #if" then */
2086 if (!cpo_match && *skipwhite(linep) == '#') 2086 if (!cpo_match && *skipwhite(linep) == '#')
2655 { 2655 {
2656 #ifdef FEAT_RIGHTLEFT 2656 #ifdef FEAT_RIGHTLEFT
2657 if (PTR2CHAR(p) == c && (curwin->w_p_rl ^ p_ri)) 2657 if (PTR2CHAR(p) == c && (curwin->w_p_rl ^ p_ri))
2658 break; 2658 break;
2659 #endif 2659 #endif
2660 p += MB_PTR2LEN(p) + 1; 2660 p += mb_ptr2len(p) + 1;
2661 if (PTR2CHAR(p) == c 2661 if (PTR2CHAR(p) == c
2662 #ifdef FEAT_RIGHTLEFT 2662 #ifdef FEAT_RIGHTLEFT
2663 && !(curwin->w_p_rl ^ p_ri) 2663 && !(curwin->w_p_rl ^ p_ri)
2664 #endif 2664 #endif
2665 ) 2665 )
2666 break; 2666 break;
2667 p += MB_PTR2LEN(p); 2667 p += mb_ptr2len(p);
2668 if (*p == NUL) 2668 if (*p == NUL)
2669 return; 2669 return;
2670 } 2670 }
2671 2671
2672 if ((lpos = findmatch(NULL, NUL)) == NULL) /* no match, so beep */ 2672 if ((lpos = findmatch(NULL, NUL)) == NULL) /* no match, so beep */
5631 * are not at the end of it already */ 5631 * are not at the end of it already */
5632 if (def_regmatch.regprog == NULL 5632 if (def_regmatch.regprog == NULL
5633 && action == ACTION_EXPAND 5633 && action == ACTION_EXPAND
5634 && !(compl_cont_status & CONT_SOL) 5634 && !(compl_cont_status & CONT_SOL)
5635 && *startp != NUL 5635 && *startp != NUL
5636 && *(p = startp + MB_PTR2LEN(startp)) != NUL) 5636 && *(p = startp + mb_ptr2len(startp)) != NUL)
5637 goto search_line; 5637 goto search_line;
5638 } 5638 }
5639 line_breakcheck(); 5639 line_breakcheck();
5640 if (action == ACTION_EXPAND) 5640 if (action == ACTION_EXPAND)
5641 ins_compl_check_keys(30, FALSE); 5641 ins_compl_check_keys(30, FALSE);