thing. These are then linked to a highlight group that specifies the color.
A syntax group name doesn't specify any color or attributes itself.
-The name for a highlight or syntax group must consist of ASCII letters, digits
-and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give
-an error when using other characters. The maximum length of a group name is
-about 200 bytes. *E1249*
+The name for a highlight or syntax group must consist of ASCII letters,
+digits, underscores, dots, or hyphens. As a regexp: "[a-zA-Z0-9_.-]*".
+However, Vim does not give an error when using other characters. The maximum
+length of a group name is about 200 bytes. *E1249*
To be able to allow each user to pick their favorite set of colors, there must
be preferred names for highlight groups that are common for many languages.
char_u *p;
char_u *name_up;
- // Check that the name is ASCII letters, digits and underscore.
+ // Check that the name is valid (ASCII letters, digits, underscores, dots, or hyphens).
for (p = name; *p != NUL; ++p)
{
if (!vim_isprintc(*p))
vim_free(name);
return 0;
}
- else if (!ASCII_ISALNUM(*p) && *p != '_')
+ else if (!ASCII_ISALNUM(*p) && *p != '_' && *p != '.' && *p != '-')
{
// This is an error, but since there previously was no check only
// give a warning.