Mercurial > vim
comparison src/syntax.c @ 1883:c8f343a465a2 v7.2.180
updated for version 7.2-180
author | vimboss |
---|---|
date | Sun, 17 May 2009 11:33:22 +0000 |
parents | 5232b9862f23 |
children | 710da9abc3c1 |
comparison
equal
deleted
inserted
replaced
1882:c8b87fa14d27 | 1883:c8f343a465a2 |
---|---|
3222 } | 3222 } |
3223 | 3223 |
3224 /* | 3224 /* |
3225 * Handle ":syntax case" command. | 3225 * Handle ":syntax case" command. |
3226 */ | 3226 */ |
3227 /* ARGSUSED */ | |
3228 static void | 3227 static void |
3229 syn_cmd_case(eap, syncing) | 3228 syn_cmd_case(eap, syncing) |
3230 exarg_T *eap; | 3229 exarg_T *eap; |
3231 int syncing; /* not used */ | 3230 int syncing UNUSED; |
3232 { | 3231 { |
3233 char_u *arg = eap->arg; | 3232 char_u *arg = eap->arg; |
3234 char_u *next; | 3233 char_u *next; |
3235 | 3234 |
3236 eap->nextcmd = find_nextcmd(arg); | 3235 eap->nextcmd = find_nextcmd(arg); |
3247 } | 3246 } |
3248 | 3247 |
3249 /* | 3248 /* |
3250 * Handle ":syntax spell" command. | 3249 * Handle ":syntax spell" command. |
3251 */ | 3250 */ |
3252 /* ARGSUSED */ | |
3253 static void | 3251 static void |
3254 syn_cmd_spell(eap, syncing) | 3252 syn_cmd_spell(eap, syncing) |
3255 exarg_T *eap; | 3253 exarg_T *eap; |
3256 int syncing; /* not used */ | 3254 int syncing UNUSED; |
3257 { | 3255 { |
3258 char_u *arg = eap->arg; | 3256 char_u *arg = eap->arg; |
3259 char_u *next; | 3257 char_u *next; |
3260 | 3258 |
3261 eap->nextcmd = find_nextcmd(arg); | 3259 eap->nextcmd = find_nextcmd(arg); |
3515 } | 3513 } |
3516 | 3514 |
3517 /* | 3515 /* |
3518 * Handle ":syntax on" command. | 3516 * Handle ":syntax on" command. |
3519 */ | 3517 */ |
3520 /* ARGSUSED */ | |
3521 static void | 3518 static void |
3522 syn_cmd_on(eap, syncing) | 3519 syn_cmd_on(eap, syncing) |
3523 exarg_T *eap; | 3520 exarg_T *eap; |
3524 int syncing; /* not used */ | 3521 int syncing UNUSED; |
3525 { | 3522 { |
3526 syn_cmd_onoff(eap, "syntax"); | 3523 syn_cmd_onoff(eap, "syntax"); |
3527 } | 3524 } |
3528 | 3525 |
3529 /* | 3526 /* |
3530 * Handle ":syntax enable" command. | 3527 * Handle ":syntax enable" command. |
3531 */ | 3528 */ |
3532 /* ARGSUSED */ | |
3533 static void | 3529 static void |
3534 syn_cmd_enable(eap, syncing) | 3530 syn_cmd_enable(eap, syncing) |
3535 exarg_T *eap; | 3531 exarg_T *eap; |
3536 int syncing; /* not used */ | 3532 int syncing UNUSED; |
3537 { | 3533 { |
3538 set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"enable"); | 3534 set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"enable"); |
3539 syn_cmd_onoff(eap, "syntax"); | 3535 syn_cmd_onoff(eap, "syntax"); |
3540 do_unlet((char_u *)"g:syntax_cmd", TRUE); | 3536 do_unlet((char_u *)"g:syntax_cmd", TRUE); |
3541 } | 3537 } |
3542 | 3538 |
3543 /* | 3539 /* |
3544 * Handle ":syntax reset" command. | 3540 * Handle ":syntax reset" command. |
3545 */ | 3541 */ |
3546 /* ARGSUSED */ | |
3547 static void | 3542 static void |
3548 syn_cmd_reset(eap, syncing) | 3543 syn_cmd_reset(eap, syncing) |
3549 exarg_T *eap; | 3544 exarg_T *eap; |
3550 int syncing; /* not used */ | 3545 int syncing UNUSED; |
3551 { | 3546 { |
3552 eap->nextcmd = check_nextcmd(eap->arg); | 3547 eap->nextcmd = check_nextcmd(eap->arg); |
3553 if (!eap->skip) | 3548 if (!eap->skip) |
3554 { | 3549 { |
3555 set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"reset"); | 3550 set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"reset"); |
3559 } | 3554 } |
3560 | 3555 |
3561 /* | 3556 /* |
3562 * Handle ":syntax manual" command. | 3557 * Handle ":syntax manual" command. |
3563 */ | 3558 */ |
3564 /* ARGSUSED */ | |
3565 static void | 3559 static void |
3566 syn_cmd_manual(eap, syncing) | 3560 syn_cmd_manual(eap, syncing) |
3567 exarg_T *eap; | 3561 exarg_T *eap; |
3568 int syncing; /* not used */ | 3562 int syncing UNUSED; |
3569 { | 3563 { |
3570 syn_cmd_onoff(eap, "manual"); | 3564 syn_cmd_onoff(eap, "manual"); |
3571 } | 3565 } |
3572 | 3566 |
3573 /* | 3567 /* |
3574 * Handle ":syntax off" command. | 3568 * Handle ":syntax off" command. |
3575 */ | 3569 */ |
3576 /* ARGSUSED */ | |
3577 static void | 3570 static void |
3578 syn_cmd_off(eap, syncing) | 3571 syn_cmd_off(eap, syncing) |
3579 exarg_T *eap; | 3572 exarg_T *eap; |
3580 int syncing; /* not used */ | 3573 int syncing UNUSED; |
3581 { | 3574 { |
3582 syn_cmd_onoff(eap, "nosyntax"); | 3575 syn_cmd_onoff(eap, "nosyntax"); |
3583 } | 3576 } |
3584 | 3577 |
3585 static void | 3578 static void |
4459 } | 4452 } |
4460 | 4453 |
4461 /* | 4454 /* |
4462 * Handle ":syntax include [@{group-name}] filename" command. | 4455 * Handle ":syntax include [@{group-name}] filename" command. |
4463 */ | 4456 */ |
4464 /* ARGSUSED */ | |
4465 static void | 4457 static void |
4466 syn_cmd_include(eap, syncing) | 4458 syn_cmd_include(eap, syncing) |
4467 exarg_T *eap; | 4459 exarg_T *eap; |
4468 int syncing; /* not used */ | 4460 int syncing UNUSED; |
4469 { | 4461 { |
4470 char_u *arg = eap->arg; | 4462 char_u *arg = eap->arg; |
4471 int sgl_id = 1; | 4463 int sgl_id = 1; |
4472 char_u *group_name_end; | 4464 char_u *group_name_end; |
4473 char_u *rest; | 4465 char_u *rest; |
4530 } | 4522 } |
4531 | 4523 |
4532 /* | 4524 /* |
4533 * Handle ":syntax keyword {group-name} [{option}] keyword .." command. | 4525 * Handle ":syntax keyword {group-name} [{option}] keyword .." command. |
4534 */ | 4526 */ |
4535 /* ARGSUSED */ | |
4536 static void | 4527 static void |
4537 syn_cmd_keyword(eap, syncing) | 4528 syn_cmd_keyword(eap, syncing) |
4538 exarg_T *eap; | 4529 exarg_T *eap; |
4539 int syncing; /* not used */ | 4530 int syncing UNUSED; |
4540 { | 4531 { |
4541 char_u *arg = eap->arg; | 4532 char_u *arg = eap->arg; |
4542 char_u *group_name_end; | 4533 char_u *group_name_end; |
4543 int syn_id; | 4534 int syn_id; |
4544 char_u *rest; | 4535 char_u *rest; |
5273 | 5264 |
5274 /* | 5265 /* |
5275 * Handle ":syntax cluster {cluster-name} [contains={groupname},..] | 5266 * Handle ":syntax cluster {cluster-name} [contains={groupname},..] |
5276 * [add={groupname},..] [remove={groupname},..]". | 5267 * [add={groupname},..] [remove={groupname},..]". |
5277 */ | 5268 */ |
5278 /* ARGSUSED */ | |
5279 static void | 5269 static void |
5280 syn_cmd_cluster(eap, syncing) | 5270 syn_cmd_cluster(eap, syncing) |
5281 exarg_T *eap; | 5271 exarg_T *eap; |
5282 int syncing; /* not used */ | 5272 int syncing UNUSED; |
5283 { | 5273 { |
5284 char_u *arg = eap->arg; | 5274 char_u *arg = eap->arg; |
5285 char_u *group_name_end; | 5275 char_u *group_name_end; |
5286 char_u *rest; | 5276 char_u *rest; |
5287 int scl_id; | 5277 int scl_id; |
5462 } | 5452 } |
5463 | 5453 |
5464 /* | 5454 /* |
5465 * Handle ":syntax sync .." command. | 5455 * Handle ":syntax sync .." command. |
5466 */ | 5456 */ |
5467 /* ARGSUSED */ | |
5468 static void | 5457 static void |
5469 syn_cmd_sync(eap, syncing) | 5458 syn_cmd_sync(eap, syncing) |
5470 exarg_T *eap; | 5459 exarg_T *eap; |
5471 int syncing; /* not used */ | 5460 int syncing UNUSED; |
5472 { | 5461 { |
5473 char_u *arg_start = eap->arg; | 5462 char_u *arg_start = eap->arg; |
5474 char_u *arg_end; | 5463 char_u *arg_end; |
5475 char_u *key = NULL; | 5464 char_u *key = NULL; |
5476 char_u *next_arg; | 5465 char_u *next_arg; |
6097 | 6086 |
6098 /* | 6087 /* |
6099 * Function given to ExpandGeneric() to obtain the list syntax names for | 6088 * Function given to ExpandGeneric() to obtain the list syntax names for |
6100 * expansion. | 6089 * expansion. |
6101 */ | 6090 */ |
6102 /*ARGSUSED*/ | |
6103 char_u * | 6091 char_u * |
6104 get_syntax_name(xp, idx) | 6092 get_syntax_name(xp, idx) |
6105 expand_T *xp; | 6093 expand_T *xp UNUSED; |
6106 int idx; | 6094 int idx; |
6107 { | 6095 { |
6108 if (expand_what == EXP_SUBCMD) | 6096 if (expand_what == EXP_SUBCMD) |
6109 return (char_u *)subcommands[idx].name; | 6097 return (char_u *)subcommands[idx].name; |
6110 return (char_u *)case_args[idx]; | 6098 return (char_u *)case_args[idx]; |
7742 # endif | 7730 # endif |
7743 | 7731 |
7744 /* | 7732 /* |
7745 * Get the font or fontset for one highlight group. | 7733 * Get the font or fontset for one highlight group. |
7746 */ | 7734 */ |
7747 /*ARGSUSED*/ | |
7748 static void | 7735 static void |
7749 hl_do_font(idx, arg, do_normal, do_menu, do_tooltip) | 7736 hl_do_font(idx, arg, do_normal, do_menu, do_tooltip) |
7750 int idx; | 7737 int idx; |
7751 char_u *arg; | 7738 char_u *arg; |
7752 int do_normal; /* set normal font */ | 7739 int do_normal; /* set normal font */ |
7753 int do_menu; /* set menu font */ | 7740 int do_menu UNUSED; /* set menu font */ |
7754 int do_tooltip; /* set tooltip font */ | 7741 int do_tooltip UNUSED; /* set tooltip font */ |
7755 { | 7742 { |
7756 # ifdef FEAT_XFONTSET | 7743 # ifdef FEAT_XFONTSET |
7757 /* If 'guifontset' is not empty, first try using the name as a | 7744 /* If 'guifontset' is not empty, first try using the name as a |
7758 * fontset. If that doesn't work, use it as a font name. */ | 7745 * fontset. If that doesn't work, use it as a font name. */ |
7759 if (*p_guifontset != NUL | 7746 if (*p_guifontset != NUL |
9148 || defined(FEAT_SIGNS) || defined(PROTO) | 9135 || defined(FEAT_SIGNS) || defined(PROTO) |
9149 /* | 9136 /* |
9150 * Function given to ExpandGeneric() to obtain the list of group names. | 9137 * Function given to ExpandGeneric() to obtain the list of group names. |
9151 * Also used for synIDattr() function. | 9138 * Also used for synIDattr() function. |
9152 */ | 9139 */ |
9153 /*ARGSUSED*/ | |
9154 char_u * | 9140 char_u * |
9155 get_highlight_name(xp, idx) | 9141 get_highlight_name(xp, idx) |
9156 expand_T *xp; | 9142 expand_T *xp UNUSED; |
9157 int idx; | 9143 int idx; |
9158 { | 9144 { |
9159 #ifdef FEAT_CMDL_COMPL | 9145 #ifdef FEAT_CMDL_COMPL |
9160 if (idx == highlight_ga.ga_len && include_none != 0) | 9146 if (idx == highlight_ga.ga_len && include_none != 0) |
9161 return (char_u *)"none"; | 9147 return (char_u *)"none"; |