Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/highlight.c b/src/highlight.c
- index 6add298b0..b6b2be721 100644
- --- a/src/highlight.c
- +++ b/src/highlight.c
- @@ -75,7 +75,6 @@ typedef struct
- char_u *sg_gui_sp_name;// GUI special color name
- #endif
- int sg_link; // link to this highlight group ID
- - int sg_deflink; // default link; restored in highlight_clear()
- int sg_set; // combination of SG_* flags
- #ifdef FEAT_EVAL
- sctx_T sg_deflink_sctx; // script where the default link was set
- @@ -644,7 +643,6 @@ highlight_group_link(
- {
- int from_id;
- int to_id;
- - hl_group_T *hlgroup = NULL;
- from_id = syn_check_group(from_hg, from_len);
- if (STRNCMP(to_hg, "NONE", 4) == 0)
- @@ -652,20 +650,7 @@ highlight_group_link(
- else
- to_id = syn_check_group(to_hg, to_len);
- - if (from_id > 0)
- - {
- - hlgroup = &HL_TABLE()[from_id - 1];
- - if (dodefault && (forceit || hlgroup->sg_deflink == 0))
- - {
- - hlgroup->sg_deflink = to_id;
- -#ifdef FEAT_EVAL
- - hlgroup->sg_deflink_sctx = current_sctx;
- - hlgroup->sg_deflink_sctx.sc_lnum += SOURCING_LNUM;
- -#endif
- - }
- - }
- -
- - if (from_id > 0 && (!init || hlgroup->sg_set == 0))
- + if (from_id > 0 && (!init || HL_TABLE()[from_id - 1].sg_set == 0))
- {
- // Don't allow a link when there already is some highlighting
- // for the group, unless '!' is used
- @@ -675,20 +660,20 @@ highlight_group_link(
- if (SOURCING_NAME == NULL && !dodefault)
- emsg(_(e_group_has_settings_highlight_link_ignored));
- }
- - else if (hlgroup->sg_link != to_id
- + else if (HL_TABLE()[from_id - 1].sg_link != to_id
- #ifdef FEAT_EVAL
- - || hlgroup->sg_script_ctx.sc_sid != current_sctx.sc_sid
- + || HL_TABLE()[from_id - 1].sg_script_ctx.sc_sid != current_sctx.sc_sid
- #endif
- - || hlgroup->sg_cleared)
- + || HL_TABLE()[from_id - 1].sg_cleared)
- {
- if (!init)
- - hlgroup->sg_set |= SG_LINK;
- - hlgroup->sg_link = to_id;
- + HL_TABLE()[from_id - 1].sg_set |= SG_LINK;
- + HL_TABLE()[from_id - 1].sg_link = to_id;
- #ifdef FEAT_EVAL
- - hlgroup->sg_script_ctx = current_sctx;
- - hlgroup->sg_script_ctx.sc_lnum += SOURCING_LNUM;
- + HL_TABLE()[from_id - 1].sg_script_ctx = current_sctx;
- + HL_TABLE()[from_id - 1].sg_script_ctx.sc_lnum += SOURCING_LNUM;
- #endif
- - hlgroup->sg_cleared = FALSE;
- + HL_TABLE()[from_id - 1].sg_cleared = FALSE;
- redraw_all_later(SOME_VALID);
- // Only call highlight_changed() once after multiple changes.
- @@ -1884,8 +1869,6 @@ highlight_clear(int idx)
- VIM_CLEAR(HL_TABLE()[idx].sg_font_name);
- HL_TABLE()[idx].sg_gui_attr = 0;
- #endif
- - // Restore default link and context if they exist. Otherwise clears.
- - HL_TABLE()[idx].sg_link = HL_TABLE()[idx].sg_deflink;
- #ifdef FEAT_EVAL
- // Since we set the default link, set the location to where the default
- // link was set.
- @@ -4192,9 +4175,6 @@ highlight_get_info(int hl_idx, int resolve_link)
- link = HL_TABLE()[sgp->sg_link - 1].sg_name;
- if (link != NULL && dict_add_string(dict, "linksto", link) == FAIL)
- goto error;
- -
- - if (sgp->sg_deflink)
- - dict_add_bool(dict, "default", VVAL_TRUE);
- }
- if (dict_len(dict) == 2)
- // If only 'name' is present, then the highlight group is cleared.
Advertisement
Add Comment
Please, Sign In to add comment