mirror of
https://github.com/neovim/neovim.git
synced 2025-11-26 04:00:45 +00:00
Merge branch 'master' into vim-8.0.0131
This commit is contained in:
@@ -5567,8 +5567,10 @@ bool syntax_present(win_T *win)
|
||||
|
||||
|
||||
static enum {
|
||||
EXP_SUBCMD, /* expand ":syn" sub-commands */
|
||||
EXP_CASE /* expand ":syn case" arguments */
|
||||
EXP_SUBCMD, // expand ":syn" sub-commands
|
||||
EXP_CASE, // expand ":syn case" arguments
|
||||
EXP_SPELL, // expand ":syn spell" arguments
|
||||
EXP_SYNC // expand ":syn sync" arguments
|
||||
} expand_what;
|
||||
|
||||
/*
|
||||
@@ -5612,6 +5614,10 @@ void set_context_in_syntax_cmd(expand_T *xp, const char *arg)
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
} else if (STRNICMP(arg, "case", p - arg) == 0) {
|
||||
expand_what = EXP_CASE;
|
||||
} else if (STRNICMP(arg, "spell", p - arg) == 0) {
|
||||
expand_what = EXP_SPELL;
|
||||
} else if (STRNICMP(arg, "sync", p - arg) == 0) {
|
||||
expand_what = EXP_SYNC;
|
||||
} else if (STRNICMP(arg, "keyword", p - arg) == 0
|
||||
|| STRNICMP(arg, "region", p - arg) == 0
|
||||
|| STRNICMP(arg, "match", p - arg) == 0
|
||||
@@ -5624,17 +5630,33 @@ void set_context_in_syntax_cmd(expand_T *xp, const char *arg)
|
||||
}
|
||||
}
|
||||
|
||||
static char *(case_args[]) = {"match", "ignore", NULL};
|
||||
|
||||
/*
|
||||
* Function given to ExpandGeneric() to obtain the list syntax names for
|
||||
* expansion.
|
||||
*/
|
||||
char_u *get_syntax_name(expand_T *xp, int idx)
|
||||
{
|
||||
if (expand_what == EXP_SUBCMD)
|
||||
return (char_u *)subcommands[idx].name;
|
||||
return (char_u *)case_args[idx];
|
||||
switch (expand_what) {
|
||||
case EXP_SUBCMD:
|
||||
return (char_u *)subcommands[idx].name;
|
||||
case EXP_CASE: {
|
||||
static char *case_args[] = { "match", "ignore", NULL };
|
||||
return (char_u *)case_args[idx];
|
||||
}
|
||||
case EXP_SPELL: {
|
||||
static char *spell_args[] =
|
||||
{ "toplevel", "notoplevel", "default", NULL };
|
||||
return (char_u *)spell_args[idx];
|
||||
}
|
||||
case EXP_SYNC: {
|
||||
static char *sync_args[] =
|
||||
{ "ccomment", "clear", "fromstart",
|
||||
"linebreaks=", "linecont", "lines=", "match",
|
||||
"maxlines=", "minlines=", "region", NULL };
|
||||
return (char_u *)sync_args[idx];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -6828,8 +6850,6 @@ int hl_combine_attr(int char_attr, int prim_attr)
|
||||
if (char_aep != NULL) {
|
||||
// Copy all attributes from char_aep to the new entry
|
||||
new_en = *char_aep;
|
||||
} else {
|
||||
memset(&new_en, 0, sizeof(new_en));
|
||||
}
|
||||
|
||||
spell_aep = syn_cterm_attr2entry(prim_attr);
|
||||
|
||||
Reference in New Issue
Block a user