patch 9.0.1767: '.-' no allowed in highlight group names
Problem: '.-' no allowed in highlight group names
Solution: Allow dot and hyphen characters in highlight group names
Allow dots and hyphens in group names. There does not seem
to be any reason for these to be disallowed.
closes: #12807
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
diff --git a/src/highlight.c b/src/highlight.c
index 3773ddf..8b1e832 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -3452,7 +3452,7 @@
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))
@@ -3461,7 +3461,7 @@
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.
diff --git a/src/version.c b/src/version.c
index 056dc29..e6f41a4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1767,
+/**/
1766,
/**/
1765,