Mercurial > vim
comparison src/menu.c @ 11129:f4ea50924c6d v8.0.0452
patch 8.0.0452: some macros are in lower case
commit https://github.com/vim/vim/commit/1c46544412382db8b3203d6c78e550df885540bd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 12 20:10:05 2017 +0100
patch 8.0.0452: some macros are in lower case
Problem: Some macros are in lower case.
Solution: Make a few more macros upper case.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 12 Mar 2017 20:15:06 +0100 |
parents | 506f5d8b7d8b |
children | 501f46f7644c |
comparison
equal
deleted
inserted
replaced
11128:23154628ab7f | 11129:f4ea50924c6d |
---|---|
165 * Fill in the priority table. | 165 * Fill in the priority table. |
166 */ | 166 */ |
167 for (p = arg; *p; ++p) | 167 for (p = arg; *p; ++p) |
168 if (!VIM_ISDIGIT(*p) && *p != '.') | 168 if (!VIM_ISDIGIT(*p) && *p != '.') |
169 break; | 169 break; |
170 if (vim_iswhite(*p)) | 170 if (VIM_ISWHITE(*p)) |
171 { | 171 { |
172 for (i = 0; i < MENUDEPTH && !vim_iswhite(*arg); ++i) | 172 for (i = 0; i < MENUDEPTH && !VIM_ISWHITE(*arg); ++i) |
173 { | 173 { |
174 pri_tab[i] = getdigits(&arg); | 174 pri_tab[i] = getdigits(&arg); |
175 if (pri_tab[i] == 0) | 175 if (pri_tab[i] == 0) |
176 pri_tab[i] = 500; | 176 pri_tab[i] = 500; |
177 if (*arg == '.') | 177 if (*arg == '.') |
191 pri_tab[MENUDEPTH] = -1; /* mark end of the table */ | 191 pri_tab[MENUDEPTH] = -1; /* mark end of the table */ |
192 | 192 |
193 /* | 193 /* |
194 * Check for "disable" or "enable" argument. | 194 * Check for "disable" or "enable" argument. |
195 */ | 195 */ |
196 if (STRNCMP(arg, "enable", 6) == 0 && vim_iswhite(arg[6])) | 196 if (STRNCMP(arg, "enable", 6) == 0 && VIM_ISWHITE(arg[6])) |
197 { | 197 { |
198 enable = TRUE; | 198 enable = TRUE; |
199 arg = skipwhite(arg + 6); | 199 arg = skipwhite(arg + 6); |
200 } | 200 } |
201 else if (STRNCMP(arg, "disable", 7) == 0 && vim_iswhite(arg[7])) | 201 else if (STRNCMP(arg, "disable", 7) == 0 && VIM_ISWHITE(arg[7])) |
202 { | 202 { |
203 enable = FALSE; | 203 enable = FALSE; |
204 arg = skipwhite(arg + 7); | 204 arg = skipwhite(arg + 7); |
205 } | 205 } |
206 | 206 |
1217 /* Check for priority numbers, enable and disable */ | 1217 /* Check for priority numbers, enable and disable */ |
1218 for (p = arg; *p; ++p) | 1218 for (p = arg; *p; ++p) |
1219 if (!VIM_ISDIGIT(*p) && *p != '.') | 1219 if (!VIM_ISDIGIT(*p) && *p != '.') |
1220 break; | 1220 break; |
1221 | 1221 |
1222 if (!vim_iswhite(*p)) | 1222 if (!VIM_ISWHITE(*p)) |
1223 { | 1223 { |
1224 if (STRNCMP(arg, "enable", 6) == 0 | 1224 if (STRNCMP(arg, "enable", 6) == 0 |
1225 && (arg[6] == NUL || vim_iswhite(arg[6]))) | 1225 && (arg[6] == NUL || VIM_ISWHITE(arg[6]))) |
1226 p = arg + 6; | 1226 p = arg + 6; |
1227 else if (STRNCMP(arg, "disable", 7) == 0 | 1227 else if (STRNCMP(arg, "disable", 7) == 0 |
1228 && (arg[7] == NUL || vim_iswhite(arg[7]))) | 1228 && (arg[7] == NUL || VIM_ISWHITE(arg[7]))) |
1229 p = arg + 7; | 1229 p = arg + 7; |
1230 else | 1230 else |
1231 p = arg; | 1231 p = arg; |
1232 } | 1232 } |
1233 | 1233 |
1234 while (*p != NUL && vim_iswhite(*p)) | 1234 while (*p != NUL && VIM_ISWHITE(*p)) |
1235 ++p; | 1235 ++p; |
1236 | 1236 |
1237 arg = after_dot = p; | 1237 arg = after_dot = p; |
1238 | 1238 |
1239 for (; *p && !vim_iswhite(*p); ++p) | 1239 for (; *p && !VIM_ISWHITE(*p); ++p) |
1240 { | 1240 { |
1241 if ((*p == '\\' || *p == Ctrl_V) && p[1] != NUL) | 1241 if ((*p == '\\' || *p == Ctrl_V) && p[1] != NUL) |
1242 p++; | 1242 p++; |
1243 else if (*p == '.') | 1243 else if (*p == '.') |
1244 after_dot = p + 1; | 1244 after_dot = p + 1; |
1245 } | 1245 } |
1246 | 1246 |
1247 /* ":tearoff" and ":popup" only use menus, not entries */ | 1247 /* ":tearoff" and ":popup" only use menus, not entries */ |
1248 expand_menus = !((*cmd == 't' && cmd[1] == 'e') || *cmd == 'p'); | 1248 expand_menus = !((*cmd == 't' && cmd[1] == 'e') || *cmd == 'p'); |
1249 expand_emenu = (*cmd == 'e'); | 1249 expand_emenu = (*cmd == 'e'); |
1250 if (expand_menus && vim_iswhite(*p)) | 1250 if (expand_menus && VIM_ISWHITE(*p)) |
1251 return NULL; /* TODO: check for next command? */ | 1251 return NULL; /* TODO: check for next command? */ |
1252 if (*p == NUL) /* Complete the menu name */ | 1252 if (*p == NUL) /* Complete the menu name */ |
1253 { | 1253 { |
1254 /* | 1254 /* |
1255 * With :unmenu, you only want to match menus for the appropriate mode. | 1255 * With :unmenu, you only want to match menus for the appropriate mode. |
2430 * Find the character just after one part of a menu name. | 2430 * Find the character just after one part of a menu name. |
2431 */ | 2431 */ |
2432 static char_u * | 2432 static char_u * |
2433 menu_skip_part(char_u *p) | 2433 menu_skip_part(char_u *p) |
2434 { | 2434 { |
2435 while (*p != NUL && *p != '.' && !vim_iswhite(*p)) | 2435 while (*p != NUL && *p != '.' && !VIM_ISWHITE(*p)) |
2436 { | 2436 { |
2437 if ((*p == '\\' || *p == Ctrl_V) && p[1] != NUL) | 2437 if ((*p == '\\' || *p == Ctrl_V) && p[1] != NUL) |
2438 ++p; | 2438 ++p; |
2439 ++p; | 2439 ++p; |
2440 } | 2440 } |
2498 static char_u * | 2498 static char_u * |
2499 menu_translate_tab_and_shift(char_u *arg_start) | 2499 menu_translate_tab_and_shift(char_u *arg_start) |
2500 { | 2500 { |
2501 char_u *arg = arg_start; | 2501 char_u *arg = arg_start; |
2502 | 2502 |
2503 while (*arg && !vim_iswhite(*arg)) | 2503 while (*arg && !VIM_ISWHITE(*arg)) |
2504 { | 2504 { |
2505 if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL) | 2505 if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL) |
2506 arg++; | 2506 arg++; |
2507 else if (STRNICMP(arg, "<TAB>", 5) == 0) | 2507 else if (STRNICMP(arg, "<TAB>", 5) == 0) |
2508 { | 2508 { |