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.
diff --git a/src/usercmd.c b/src/usercmd.c
index 1a6fbee..7ff7f02 100644
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -191,7 +191,7 @@
{
xp->xp_arg = uc->uc_compl_arg;
xp->xp_script_ctx = uc->uc_script_ctx;
- xp->xp_script_ctx.sc_lnum += sourcing_lnum;
+ xp->xp_script_ctx.sc_lnum += SOURCING_LNUM;
}
# endif
// Do not search for further abbreviations
@@ -956,7 +956,7 @@
cmd->uc_compl = compl;
#ifdef FEAT_EVAL
cmd->uc_script_ctx = current_sctx;
- cmd->uc_script_ctx.sc_lnum += sourcing_lnum;
+ cmd->uc_script_ctx.sc_lnum += SOURCING_LNUM;
cmd->uc_compl_arg = compl_arg;
#endif
cmd->uc_addr_type = addr_type;