comparison src/misc1.c @ 11127:506f5d8b7d8b v8.0.0451

patch 8.0.0451: some macros are in lower case commit https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 12 19:22:36 2017 +0100 patch 8.0.0451: some macros are in lower case Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice.
author Christian Brabandt <cb@256bit.org>
date Sun, 12 Mar 2017 19:30:05 +0100
parents 778c10516955
children f4ea50924c6d
comparison
equal deleted inserted replaced
11126:48599a3eae0b 11127:506f5d8b7d8b
1138 char_u *endp = p; 1138 char_u *endp = p;
1139 int l; 1139 int l;
1140 1140
1141 while (old_size < repl_size && p > leader) 1141 while (old_size < repl_size && p > leader)
1142 { 1142 {
1143 mb_ptr_back(leader, p); 1143 MB_PTR_BACK(leader, p);
1144 old_size += ptr2cells(p); 1144 old_size += ptr2cells(p);
1145 } 1145 }
1146 l = lead_repl_len - (int)(endp - p); 1146 l = lead_repl_len - (int)(endp - p);
1147 if (l != 0) 1147 if (l != 0)
1148 mch_memmove(endp + l, endp, 1148 mch_memmove(endp + l, endp,
2068 2068
2069 col = 0; 2069 col = 0;
2070 while (*s != NUL && --column >= 0) 2070 while (*s != NUL && --column >= 0)
2071 { 2071 {
2072 col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL); 2072 col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL);
2073 mb_ptr_adv(s); 2073 MB_PTR_ADV(s);
2074 } 2074 }
2075 2075
2076 /* 2076 /*
2077 * If *s is a TAB, and the TAB is not displayed as ^I, and we're not in 2077 * If *s is a TAB, and the TAB is not displayed as ^I, and we're not in
2078 * INSERT mode, then col must be adjusted so that it represents the last 2078 * INSERT mode, then col must be adjusted so that it represents the last
4835 return (char_u *)""; 4835 return (char_u *)"";
4836 for (p1 = p2 = get_past_head(fname); *p2; ) /* find last part of path */ 4836 for (p1 = p2 = get_past_head(fname); *p2; ) /* find last part of path */
4837 { 4837 {
4838 if (vim_ispathsep_nocolon(*p2)) 4838 if (vim_ispathsep_nocolon(*p2))
4839 p1 = p2 + 1; 4839 p1 = p2 + 1;
4840 mb_ptr_adv(p2); 4840 MB_PTR_ADV(p2);
4841 } 4841 }
4842 return p1; 4842 return p1;
4843 } 4843 }
4844 4844
4845 #if defined(FEAT_SEARCHPATH) 4845 #if defined(FEAT_SEARCHPATH)
4873 { 4873 {
4874 if (!look_for_sep) 4874 if (!look_for_sep)
4875 dir_end = next_dir_end; 4875 dir_end = next_dir_end;
4876 look_for_sep = TRUE; 4876 look_for_sep = TRUE;
4877 } 4877 }
4878 mb_ptr_adv(p); 4878 MB_PTR_ADV(p);
4879 } 4879 }
4880 return dir_end; 4880 return dir_end;
4881 } 4881 }
4882 #endif 4882 #endif
4883 4883
4908 */ 4908 */
4909 char_u * 4909 char_u *
4910 getnextcomp(char_u *fname) 4910 getnextcomp(char_u *fname)
4911 { 4911 {
4912 while (*fname && !vim_ispathsep(*fname)) 4912 while (*fname && !vim_ispathsep(*fname))
4913 mb_ptr_adv(fname); 4913 MB_PTR_ADV(fname);
4914 if (*fname) 4914 if (*fname)
4915 ++fname; 4915 ++fname;
4916 return fname; 4916 return fname;
4917 } 4917 }
4918 4918
10376 /* find the previous separator */ 10376 /* find the previous separator */
10377 while (*psep > path) 10377 while (*psep > path)
10378 { 10378 {
10379 if (vim_ispathsep(**psep)) 10379 if (vim_ispathsep(**psep))
10380 return OK; 10380 return OK;
10381 mb_ptr_back(path, *psep); 10381 MB_PTR_BACK(path, *psep);
10382 } 10382 }
10383 10383
10384 return FAIL; 10384 return FAIL;
10385 } 10385 }
10386 10386
10531 } 10531 }
10532 10532
10533 /* skip to the file or directory name */ 10533 /* skip to the file or directory name */
10534 if (cutoff != NULL) 10534 if (cutoff != NULL)
10535 while (vim_ispathsep(*cutoff)) 10535 while (vim_ispathsep(*cutoff))
10536 mb_ptr_adv(cutoff); 10536 MB_PTR_ADV(cutoff);
10537 10537
10538 return cutoff; 10538 return cutoff;
10539 } 10539 }
10540 10540
10541 /* 10541 /*
10788 * Allowing for escaping. 10788 * Allowing for escaping.
10789 */ 10789 */
10790 static int 10790 static int
10791 has_env_var(char_u *p) 10791 has_env_var(char_u *p)
10792 { 10792 {
10793 for ( ; *p; mb_ptr_adv(p)) 10793 for ( ; *p; MB_PTR_ADV(p))
10794 { 10794 {
10795 if (*p == '\\' && p[1] != NUL) 10795 if (*p == '\\' && p[1] != NUL)
10796 ++p; 10796 ++p;
10797 else if (vim_strchr((char_u *) 10797 else if (vim_strchr((char_u *)
10798 #if defined(MSWIN) 10798 #if defined(MSWIN)
10814 * cannot expand, requires using a shell. 10814 * cannot expand, requires using a shell.
10815 */ 10815 */
10816 static int 10816 static int
10817 has_special_wildchar(char_u *p) 10817 has_special_wildchar(char_u *p)
10818 { 10818 {
10819 for ( ; *p; mb_ptr_adv(p)) 10819 for ( ; *p; MB_PTR_ADV(p))
10820 { 10820 {
10821 /* Allow for escaping. */ 10821 /* Allow for escaping. */
10822 if (*p == '\\' && p[1] != NUL) 10822 if (*p == '\\' && p[1] != NUL)
10823 ++p; 10823 ++p;
10824 else if (vim_strchr((char_u *)SPECIAL_WILDCHAR, *p) != NULL) 10824 else if (vim_strchr((char_u *)SPECIAL_WILDCHAR, *p) != NULL)
11291 { 11291 {
11292 char_u *p1, *p2; 11292 char_u *p1, *p2;
11293 11293
11294 /* Find the last path separator before the space. */ 11294 /* Find the last path separator before the space. */
11295 p1 = p_sh; 11295 p1 = p_sh;
11296 for (p2 = p_sh; p2 < p; mb_ptr_adv(p2)) 11296 for (p2 = p_sh; p2 < p; MB_PTR_ADV(p2))
11297 if (vim_ispathsep(*p2)) 11297 if (vim_ispathsep(*p2))
11298 p1 = p2 + 1; 11298 p1 = p2 + 1;
11299 p = vim_strnsave(p1, (int)(p - p1)); 11299 p = vim_strnsave(p1, (int)(p - p1));
11300 } 11300 }
11301 #endif 11301 #endif