diff options
author | Drew Vogel <dvogel@github> | 2021-11-13 10:50:01 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-13 10:50:01 +0000 |
commit | a0fca17251bf491db7b8d302ce22dee844597e82 (patch) | |
tree | 32a0b8da8cefe1d96584689f6676d57fec38fed4 /src/highlight.c | |
parent | 5300be620c77950caa5296019408ee02e60097e8 (diff) | |
download | vim-git-a0fca17251bf491db7b8d302ce22dee844597e82.tar.gz |
patch 8.2.3590: test for v:colornames sometimes failsv8.2.3590
Problem: Test for v:colornames sometimes fails. (Dominique Pellé)
Solution: Check features. Clear v:colornames between tests. (Drew Vogel,
closes #9105, closes #9073)
Diffstat (limited to 'src/highlight.c')
-rw-r--r-- | src/highlight.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/highlight.c b/src/highlight.c index 02790c668..a2935f50b 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -2332,39 +2332,6 @@ colorname2rgb(char_u *name) return INVALCOLOR; } -// Maps the given name to the given color value, overwriting any current -// mapping. If allocation fails the named color will no longer exist in the -// table and the user will receive an error message. - void -save_colorname_hexstr(int r, int g, int b, char_u *name) -{ - int result; - dict_T *colornames_table; - dictitem_T *existing; - char_u hexstr[8]; - - if (vim_snprintf((char *)hexstr, sizeof(hexstr), - "#%02x%02x%02x", r, g, b) < 0) - { - semsg(_(e_cannot_allocate_color_str), name); - return; - } - - colornames_table = get_vim_var_dict(VV_COLORNAMES); - // The colornames_table dict is safe to use here because it is allocated at - // startup in evalvars.c - existing = dict_find(colornames_table, name, -1); - if (existing != NULL) - { - dictitem_remove(colornames_table, existing); - existing = NULL; // dictitem_remove freed the item - } - - result = dict_add_string(colornames_table, (char *)name, hexstr); - if (result == FAIL) - semsg(_(e_cannot_allocate_color_str), name); -} - /* * Load a default color list. Intended to support legacy color names but allows * the user to override the color values. Only loaded once. |