diff options
author | James McCoy <jamessan@jamessan.com> | 2021-12-09 21:29:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-09 21:29:15 -0500 |
commit | ac2d140a33dfe88f882218e15a443b8300cca6b2 (patch) | |
tree | e2b724239fa4105e04c15ff964da033a82afa369 /src/nvim/syntax.c | |
parent | 238da85126c5a1dee03a75b6023a36a9a3642dda (diff) | |
parent | f3fb77c40262f47e30ebefec547f5c6f83ff58e6 (diff) | |
download | rneovim-ac2d140a33dfe88f882218e15a443b8300cca6b2.tar.gz rneovim-ac2d140a33dfe88f882218e15a443b8300cca6b2.tar.bz2 rneovim-ac2d140a33dfe88f882218e15a443b8300cca6b2.zip |
Merge pull request #16541 from jamessan/vim-8.2.3664
vim-patch:8.2.3664,8.2.3743,8.2.3747,8.2.3748,8.2.3757
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index cb243668ce..9a133eeadf 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -115,6 +115,8 @@ static int include_none = 0; // when 1 include "nvim/None" static int include_default = 0; // when 1 include "nvim/default" static int include_link = 0; // when 2 include "nvim/link" and "clear" +#define MAX_SYN_NAME 200 + /// The "term", "cterm" and "gui" arguments can be any combination of the /// following names, separated by commas (but no spaces!). static char *(hl_name_table[]) = @@ -6175,6 +6177,8 @@ static const char *highlight_init_both[] = { "default link LineNrAbove LineNr", "default link LineNrBelow LineNr", "default link QuickFixLine Search", + "default link CursorLineSign SignColumn", + "default link CursorLineFold FoldColumn", "default link Substitute Search", "default link Whitespace NonText", "default link MsgSeparator StatusLine", @@ -7623,10 +7627,9 @@ int syn_name2id(const char *name) int syn_name2id_len(const char_u *name, size_t len) FUNC_ATTR_NONNULL_ALL { - char name_u[201]; + char name_u[MAX_SYN_NAME + 1]; - if (len == 0 || len > 200) { - // ID names over 200 chars don't deserve to be found! + if (len == 0 || len > MAX_SYN_NAME) { return 0; } @@ -7684,6 +7687,10 @@ char_u *syn_id2name(int id) /// @return 0 for failure else the id of the group int syn_check_group(const char *name, int len) { + if (len > MAX_SYN_NAME) { + emsg(_(e_highlight_group_name_too_long)); + return 0; + } int id = syn_name2id_len((char_u *)name, len); if (id == 0) { // doesn't exist yet return syn_add_group(vim_strnsave((char_u *)name, len)); |