This commit is contained in:
dvejmz
2018-01-09 22:58:24 +00:00
parent b23fc444b5
commit 34de6d33c9

View File

@@ -3027,9 +3027,9 @@ static void syn_cmd_conceal(exarg_T *eap, int syncing)
MSG(_("syn conceal off")); MSG(_("syn conceal off"));
} }
} else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2) { } else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2) {
curwin->w_s->b_syn_conceal = TRUE; curwin->w_s->b_syn_conceal = true;
} else if (STRNICMP(arg, "off", 3) == 0 && next - arg == 3) { } else if (STRNICMP(arg, "off", 3) == 0 && next - arg == 3) {
curwin->w_s->b_syn_conceal = FALSE; curwin->w_s->b_syn_conceal = false;
} else { } else {
EMSG2(_("E390: Illegal argument: %s"), arg); EMSG2(_("E390: Illegal argument: %s"), arg);
} }
@@ -3055,9 +3055,9 @@ static void syn_cmd_case(exarg_T *eap, int syncing)
MSG(_("syntax case match")); MSG(_("syntax case match"));
} }
} else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5) { } else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5) {
curwin->w_s->b_syn_ic = FALSE; curwin->w_s->b_syn_ic = false;
} else if (STRNICMP(arg, "ignore", 6) == 0 && next - arg == 6) { } else if (STRNICMP(arg, "ignore", 6) == 0 && next - arg == 6) {
curwin->w_s->b_syn_ic = TRUE; curwin->w_s->b_syn_ic = true;
} else { } else {
EMSG2(_("E390: Illegal argument: %s"), arg); EMSG2(_("E390: Illegal argument: %s"), arg);
} }
@@ -3144,11 +3144,11 @@ static void syn_cmd_iskeyword(exarg_T *eap, int syncing)
*/ */
void syntax_clear(synblock_T *block) void syntax_clear(synblock_T *block)
{ {
block->b_syn_error = FALSE; /* clear previous error */ block->b_syn_error = false; // clear previous error
block->b_syn_ic = FALSE; /* Use case, by default */ block->b_syn_ic = false; // Use case, by default
block->b_syn_spell = SYNSPL_DEFAULT; /* default spell checking */ block->b_syn_spell = SYNSPL_DEFAULT; // default spell checking
block->b_syn_containedin = FALSE; block->b_syn_containedin = false;
block->b_syn_conceal = FALSE; block->b_syn_conceal = false;
/* free the keywords */ /* free the keywords */
clear_keywtab(&block->b_keywtab); clear_keywtab(&block->b_keywtab);
@@ -4025,11 +4025,11 @@ get_group_name (
* Return NULL for any error; * Return NULL for any error;
*/ */
static char_u * static char_u *
get_syn_options ( get_syn_options(
char_u *arg, /* next argument to be checked */ char_u *arg, // next argument to be checked
syn_opt_arg_T *opt, /* various things */ syn_opt_arg_T *opt, // various things
int *conceal_char, int *conceal_char,
int skip /* TRUE if skipping over command */ int skip // TRUE if skipping over command
) )
{ {
char_u *gname_start, *gname; char_u *gname_start, *gname;
@@ -4105,14 +4105,17 @@ get_syn_options (
EMSG(_("E395: contains argument not accepted here")); EMSG(_("E395: contains argument not accepted here"));
return NULL; return NULL;
} }
if (get_id_list(&arg, 8, &opt->cont_list, skip) == FAIL) if (get_id_list(&arg, 8, &opt->cont_list, skip) == FAIL) {
return NULL; return NULL;
}
} else if (flagtab[fidx].argtype == 2) { } else if (flagtab[fidx].argtype == 2) {
if (get_id_list(&arg, 11, &opt->cont_in_list, skip) == FAIL) if (get_id_list(&arg, 11, &opt->cont_in_list, skip) == FAIL) {
return NULL; return NULL;
}
} else if (flagtab[fidx].argtype == 3) { } else if (flagtab[fidx].argtype == 3) {
if (get_id_list(&arg, 9, &opt->next_list, skip) == FAIL) if (get_id_list(&arg, 9, &opt->next_list, skip) == FAIL) {
return NULL; return NULL;
}
} else if (flagtab[fidx].argtype == 11 && arg[5] == '=') { } else if (flagtab[fidx].argtype == 11 && arg[5] == '=') {
/* cchar=? */ /* cchar=? */
if (has_mbyte) { if (has_mbyte) {
@@ -4410,10 +4413,11 @@ syn_cmd_match (
init_syn_patterns(); init_syn_patterns();
memset(&item, 0, sizeof(item)); memset(&item, 0, sizeof(item));
rest = get_syn_pattern(rest, &item); rest = get_syn_pattern(rest, &item);
if (vim_regcomp_had_eol() && !(syn_opt_arg.flags & HL_EXCLUDENL)) if (vim_regcomp_had_eol() && !(syn_opt_arg.flags & HL_EXCLUDENL)) {
syn_opt_arg.flags |= HL_HAS_EOL; syn_opt_arg.flags |= HL_HAS_EOL;
}
/* Get options after the pattern */ // Get options after the pattern
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip); rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
if (rest != NULL) { /* all arguments are valid */ if (rest != NULL) { /* all arguments are valid */
@@ -4526,14 +4530,13 @@ syn_cmd_region (
syn_opt_arg.cont_in_list = NULL; syn_opt_arg.cont_in_list = NULL;
syn_opt_arg.next_list = NULL; syn_opt_arg.next_list = NULL;
/* // get the options, patterns and matchgroup.
* get the options, patterns and matchgroup.
*/
while (rest != NULL && !ends_excmd(*rest)) { while (rest != NULL && !ends_excmd(*rest)) {
/* Check for option arguments */ // Check for option arguments
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip); rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
if (rest == NULL || ends_excmd(*rest)) if (rest == NULL || ends_excmd(*rest)) {
break; break;
}
/* must be a pattern or matchgroup then */ /* must be a pattern or matchgroup then */
key_end = rest; key_end = rest;
@@ -4963,7 +4966,7 @@ static void syn_cmd_cluster(exarg_T *eap, int syncing)
syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list, syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list,
&clstr_list, list_op); &clstr_list, list_op);
} }
got_clstr = TRUE; got_clstr = true;
} }
if (got_clstr) { if (got_clstr) {
@@ -5211,9 +5214,9 @@ static void syn_cmd_sync(exarg_T *eap, int syncing)
static int static int
get_id_list ( get_id_list (
char_u **arg, char_u **arg,
int keylen, /* length of keyword */ int keylen, // length of keyword
short **list, /* where to store the resulting list, if not int16_t **list, // where to store the resulting list, if not
NULL, the list is silently skipped! */ // NULL, the list is silently skipped!
int skip int skip
) )
{ {
@@ -7774,11 +7777,11 @@ const char *get_highlight_name(expand_T *const xp, const int idx)
return NULL; return NULL;
} }
/* Items are never removed from the table, skip the ones that were cleared. // Items are never removed from the table, skip the ones that were cleared.
*/
int current_idx = idx; int current_idx = idx;
while (current_idx < highlight_ga.ga_len && HL_TABLE()[current_idx].sg_cleared) { while (current_idx < highlight_ga.ga_len
++current_idx; && HL_TABLE()[current_idx].sg_cleared) {
current_idx++;
} }
if (current_idx >= highlight_ga.ga_len) { if (current_idx >= highlight_ga.ga_len) {
return NULL; return NULL;