From 1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 29 Dec 2019 23:04:25 +0100 Subject: patch 8.2.0056: execution stack is incomplete and inefficient Problem: Execution stack is incomplete and inefficient. Solution: Introduce a proper execution stack and use it instead of sourcing_name/sourcing_lnum. Create a string only when used. --- src/highlight.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/highlight.c') diff --git a/src/highlight.c b/src/highlight.c index 40dda6452e..19aafffe5a 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -748,7 +748,7 @@ do_highlight( if (to_id > 0 && !forceit && !init && hl_has_settings(from_id - 1, dodefault)) { - if (sourcing_name == NULL && !dodefault) + if (SOURCING_NAME == NULL && !dodefault) emsg(_("E414: group has settings, highlight link ignored")); } else if (HL_TABLE()[from_id - 1].sg_link != to_id @@ -763,7 +763,7 @@ do_highlight( HL_TABLE()[from_id - 1].sg_link = to_id; #ifdef FEAT_EVAL 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_script_ctx.sc_lnum += SOURCING_LNUM; #endif HL_TABLE()[from_id - 1].sg_cleared = FALSE; redraw_all_later(SOME_VALID); @@ -1518,7 +1518,7 @@ do_highlight( set_hl_attr(idx); #ifdef FEAT_EVAL HL_TABLE()[idx].sg_script_ctx = current_sctx; - HL_TABLE()[idx].sg_script_ctx.sc_lnum += sourcing_lnum; + HL_TABLE()[idx].sg_script_ctx.sc_lnum += SOURCING_LNUM; #endif } -- cgit v1.2.3