Guest User

Vim 8.2.4747 patch reverting 8.2.1703 to fix vim-syntax-bind-named

a guest
Apr 14th, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.21 KB | None | 0 0
  1. diff --git a/src/highlight.c b/src/highlight.c
  2. index 6add298b0..b6b2be721 100644
  3. --- a/src/highlight.c
  4. +++ b/src/highlight.c
  5. @@ -75,7 +75,6 @@ typedef struct
  6.      char_u *sg_gui_sp_name;// GUI special color name
  7.  #endif
  8.      int        sg_link;    // link to this highlight group ID
  9. -    int        sg_deflink; // default link; restored in highlight_clear()
  10.      int        sg_set;     // combination of SG_* flags
  11.  #ifdef FEAT_EVAL
  12.      sctx_T sg_deflink_sctx;  // script where the default link was set
  13. @@ -644,7 +643,6 @@ highlight_group_link(
  14.  {
  15.      int        from_id;
  16.      int        to_id;
  17. -    hl_group_T *hlgroup = NULL;
  18.  
  19.      from_id = syn_check_group(from_hg, from_len);
  20.      if (STRNCMP(to_hg, "NONE", 4) == 0)
  21. @@ -652,20 +650,7 @@ highlight_group_link(
  22.      else
  23.     to_id = syn_check_group(to_hg, to_len);
  24.  
  25. -    if (from_id > 0)
  26. -    {
  27. -   hlgroup = &HL_TABLE()[from_id - 1];
  28. -   if (dodefault && (forceit || hlgroup->sg_deflink == 0))
  29. -   {
  30. -       hlgroup->sg_deflink = to_id;
  31. -#ifdef FEAT_EVAL
  32. -       hlgroup->sg_deflink_sctx = current_sctx;
  33. -       hlgroup->sg_deflink_sctx.sc_lnum += SOURCING_LNUM;
  34. -#endif
  35. -   }
  36. -    }
  37. -
  38. -    if (from_id > 0 && (!init || hlgroup->sg_set == 0))
  39. +    if (from_id > 0 && (!init || HL_TABLE()[from_id - 1].sg_set == 0))
  40.      {
  41.     // Don't allow a link when there already is some highlighting
  42.     // for the group, unless '!' is used
  43. @@ -675,20 +660,20 @@ highlight_group_link(
  44.         if (SOURCING_NAME == NULL && !dodefault)
  45.         emsg(_(e_group_has_settings_highlight_link_ignored));
  46.     }
  47. -   else if (hlgroup->sg_link != to_id
  48. +   else if (HL_TABLE()[from_id - 1].sg_link != to_id
  49.  #ifdef FEAT_EVAL
  50. -       || hlgroup->sg_script_ctx.sc_sid != current_sctx.sc_sid
  51. +       || HL_TABLE()[from_id - 1].sg_script_ctx.sc_sid != current_sctx.sc_sid
  52.  #endif
  53. -       || hlgroup->sg_cleared)
  54. +       || HL_TABLE()[from_id - 1].sg_cleared)
  55.     {
  56.         if (!init)
  57. -       hlgroup->sg_set |= SG_LINK;
  58. -       hlgroup->sg_link = to_id;
  59. +       HL_TABLE()[from_id - 1].sg_set |= SG_LINK;
  60. +       HL_TABLE()[from_id - 1].sg_link = to_id;
  61.  #ifdef FEAT_EVAL
  62. -       hlgroup->sg_script_ctx = current_sctx;
  63. -       hlgroup->sg_script_ctx.sc_lnum += SOURCING_LNUM;
  64. +       HL_TABLE()[from_id - 1].sg_script_ctx = current_sctx;
  65. +       HL_TABLE()[from_id - 1].sg_script_ctx.sc_lnum += SOURCING_LNUM;
  66.  #endif
  67. -       hlgroup->sg_cleared = FALSE;
  68. +       HL_TABLE()[from_id - 1].sg_cleared = FALSE;
  69.         redraw_all_later(SOME_VALID);
  70.  
  71.         // Only call highlight_changed() once after multiple changes.
  72. @@ -1884,8 +1869,6 @@ highlight_clear(int idx)
  73.      VIM_CLEAR(HL_TABLE()[idx].sg_font_name);
  74.      HL_TABLE()[idx].sg_gui_attr = 0;
  75.  #endif
  76. -    // Restore default link and context if they exist. Otherwise clears.
  77. -    HL_TABLE()[idx].sg_link = HL_TABLE()[idx].sg_deflink;
  78.  #ifdef FEAT_EVAL
  79.      // Since we set the default link, set the location to where the default
  80.      // link was set.
  81. @@ -4192,9 +4175,6 @@ highlight_get_info(int hl_idx, int resolve_link)
  82.     link = HL_TABLE()[sgp->sg_link - 1].sg_name;
  83.     if (link != NULL && dict_add_string(dict, "linksto", link) == FAIL)
  84.         goto error;
  85. -
  86. -   if (sgp->sg_deflink)
  87. -       dict_add_bool(dict, "default", VVAL_TRUE);
  88.      }
  89.      if (dict_len(dict) == 2)
  90.     // If only 'name' is present, then the highlight group is cleared.
  91.  
Advertisement
Add Comment
Please, Sign In to add comment