diff options
| author | bfredl <bjorn.linse@gmail.com> | 2022-08-24 21:08:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-24 21:08:21 +0200 |
| commit | c545d514dfe1f45f86a54b313082c5171bb0ce1b (patch) | |
| tree | 6095614b6795a105c0e1b2bfc7cc00e0754cd951 /src/nvim/highlight_group.c | |
| parent | 3b2121cedfd7c2710b69bd38a3eb2ce51e0205e4 (diff) | |
| parent | 61be343ec8c5e4d504db7ba975b20af2f46ce50d (diff) | |
| download | rneovim-c545d514dfe1f45f86a54b313082c5171bb0ce1b.tar.gz rneovim-c545d514dfe1f45f86a54b313082c5171bb0ce1b.tar.bz2 rneovim-c545d514dfe1f45f86a54b313082c5171bb0ce1b.zip | |
Merge pull request #19830 from lewis6991/hlgroup_name
feat(highlight)!: error on invalid names and allow '.' and '@'
Diffstat (limited to 'src/nvim/highlight_group.c')
| -rw-r--r-- | src/nvim/highlight_group.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c index b486b282ea..30c39a3158 100644 --- a/src/nvim/highlight_group.c +++ b/src/nvim/highlight_group.c @@ -1750,11 +1750,11 @@ static int syn_add_group(const char *name, size_t len) if (!vim_isprintc(c)) { emsg(_("E669: Unprintable character in group name")); return 0; - } else if (!ASCII_ISALNUM(c) && c != '_') { - // This is an error, but since there previously was no check only give a warning. + } else if (!ASCII_ISALNUM(c) && c != '_' && c != '.' && c != '@') { + // '.' and '@' are allowed characters for use with treesitter capture names. msg_source(HL_ATTR(HLF_W)); - msg(_("W18: Invalid character in group name")); - break; + emsg(_(e_highlight_group_name_invalid_char)); + return 0; } } |