diff options
Diffstat (limited to 'src/nvim/highlight_group.c')
-rw-r--r-- | src/nvim/highlight_group.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c index 38af2a708a..cce124de77 100644 --- a/src/nvim/highlight_group.c +++ b/src/nvim/highlight_group.c @@ -218,6 +218,8 @@ static const char *highlight_init_both[] = { "default link DiagnosticSignInfo DiagnosticInfo", "default link DiagnosticSignHint DiagnosticHint", "default link DiagnosticSignOk DiagnosticOk", + "default DiagnosticDeprecated cterm=strikethrough gui=strikethrough guisp=Red", + "default link DiagnosticUnnecessary Comment", // Text "default link @text.literal Comment", @@ -795,9 +797,9 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id) } HlGroup *g = &hl_table[idx]; + g->sg_cleared = false; if (link_id > 0) { - g->sg_cleared = false; g->sg_link = link_id; g->sg_script_ctx = current_sctx; g->sg_script_ctx.sc_lnum += SOURCING_LNUM; @@ -807,11 +809,10 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id) g->sg_deflink_sctx = current_sctx; g->sg_deflink_sctx.sc_lnum += SOURCING_LNUM; } - goto update; + } else { + g->sg_link = 0; } - g->sg_cleared = false; - g->sg_link = 0; g->sg_gui = attrs.rgb_ae_attr; g->sg_rgb_fg = attrs.rgb_fg_color; @@ -863,7 +864,6 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id) } } -update: if (!updating_screen) { redraw_all_later(UPD_NOT_VALID); } @@ -1531,17 +1531,15 @@ static bool hlgroup2dict(Dictionary *hl, NS ns_id, int hl_id, Arena *arena) } HlAttrs attr = syn_attr2entry(ns_id == 0 ? sgp->sg_attr : ns_get_hl(&ns_id, hl_id, false, sgp->sg_set)); + *hl = arena_dict(arena, HLATTRS_DICT_SIZE + 1); if (link > 0) { - *hl = arena_dict(arena, 1); PUT_C(*hl, "link", STRING_OBJ(cstr_as_string(hl_table[link - 1].sg_name))); - } else { - *hl = arena_dict(arena, HLATTRS_DICT_SIZE); - Dictionary hl_cterm = arena_dict(arena, HLATTRS_DICT_SIZE); - hlattrs2dict(hl, NULL, attr, true, true); - hlattrs2dict(hl, &hl_cterm, attr, false, true); - if (kv_size(hl_cterm)) { - PUT_C(*hl, "cterm", DICTIONARY_OBJ(hl_cterm)); - } + } + Dictionary hl_cterm = arena_dict(arena, HLATTRS_DICT_SIZE); + hlattrs2dict(hl, NULL, attr, true, true); + hlattrs2dict(hl, &hl_cterm, attr, false, true); + if (kv_size(hl_cterm)) { + PUT_C(*hl, "cterm", DICTIONARY_OBJ(hl_cterm)); } return true; } @@ -1633,7 +1631,7 @@ static bool highlight_list_arg(const int id, bool didh, const int type, int iarg } } - (void)syn_list_header(didh, vim_strsize((char *)ts) + (int)strlen(name) + 1, id, false); + (void)syn_list_header(didh, vim_strsize(ts) + (int)strlen(name) + 1, id, false); didh = true; if (!got_int) { if (*name != NUL) { |