diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-05 14:10:32 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-05 14:10:32 -0700 |
commit | 8b06231612cd608b2dce5e0a09bf40192a4803cb (patch) | |
tree | 04fbfef7b326574e296b2fe1a772829ac0af8be4 /src/nvim/syntax.c | |
parent | 096212d52c6375c19c046d86a7178bae91e287fc (diff) | |
parent | d3f1eb3024fa297c970a79dd24ef818e4aeb8525 (diff) | |
download | rneovim-8b06231612cd608b2dce5e0a09bf40192a4803cb.tar.gz rneovim-8b06231612cd608b2dce5e0a09bf40192a4803cb.tar.bz2 rneovim-8b06231612cd608b2dce5e0a09bf40192a4803cb.zip |
Merge #10869 'vim-patch:8.1.{0309,0362,0365,0515,1946}'
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 4b9e84745a..f7de5f00d0 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -60,7 +60,7 @@ struct hl_group { int sg_attr; ///< Screen attr @see ATTR_ENTRY int sg_link; ///< link to this highlight group ID int sg_set; ///< combination of flags in \ref SG_SET - scid_T sg_scriptID; ///< script in which the group was last set + sctx_T sg_script_ctx; ///< script in which the group was last set // for terminal UIs int sg_cterm; ///< "cterm=" highlighting attr ///< (combination of \ref HlAttrFlags) @@ -6565,13 +6565,15 @@ void do_highlight(const char *line, const bool forceit, const bool init) EMSG(_("E414: group has settings, highlight link ignored")); } } else if (HL_TABLE()[from_id - 1].sg_link != to_id - || HL_TABLE()[from_id - 1].sg_scriptID != current_SID + || HL_TABLE()[from_id - 1].sg_script_ctx.sc_sid + != current_sctx.sc_sid || HL_TABLE()[from_id - 1].sg_cleared) { if (!init) { HL_TABLE()[from_id - 1].sg_set |= SG_LINK; } HL_TABLE()[from_id - 1].sg_link = to_id; - HL_TABLE()[from_id - 1].sg_scriptID = current_SID; + HL_TABLE()[from_id - 1].sg_script_ctx = current_sctx; + HL_TABLE()[from_id - 1].sg_script_ctx.sc_lnum += sourcing_lnum; HL_TABLE()[from_id - 1].sg_cleared = false; redraw_all_later(SOME_VALID); @@ -6950,7 +6952,8 @@ void do_highlight(const char *line, const bool forceit, const bool init) } else { set_hl_attr(idx); } - HL_TABLE()[idx].sg_scriptID = current_SID; + HL_TABLE()[idx].sg_script_ctx = current_sctx; + HL_TABLE()[idx].sg_script_ctx.sc_lnum += sourcing_lnum; } xfree(key); xfree(arg); @@ -7034,7 +7037,8 @@ static void highlight_clear(int idx) // Clear the script ID only when there is no link, since that is not // cleared. if (HL_TABLE()[idx].sg_link == 0) { - HL_TABLE()[idx].sg_scriptID = 0; + HL_TABLE()[idx].sg_script_ctx.sc_sid = 0; + HL_TABLE()[idx].sg_script_ctx.sc_lnum = 0; } } @@ -7084,8 +7088,9 @@ static void highlight_list_one(const int id) if (!didh) highlight_list_arg(id, didh, LIST_STRING, 0, (char_u *)"cleared", ""); - if (p_verbose > 0) - last_set_msg(sgp->sg_scriptID); + if (p_verbose > 0) { + last_set_msg(sgp->sg_script_ctx); + } } /// Outputs a highlight when doing ":hi MyHighlight" |