patch 8.1.0362: cannot get the script line number when executing a function
Problem: Cannot get the script line number when executing a function.
Solution: Store the line number besides the script ID. (Ozaki Kiichi,
closes #3362) Also display the line number with ":verbose set".
diff --git a/src/getchar.c b/src/getchar.c
index 496e33f..cc8b344 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3677,7 +3677,8 @@
mp->m_mode = mode;
#ifdef FEAT_EVAL
mp->m_expr = expr;
- mp->m_script_ID = current_SID;
+ mp->m_script_ctx = current_sctx;
+ mp->m_script_ctx.sc_lnum += sourcing_lnum;
#endif
did_it = TRUE;
}
@@ -3783,7 +3784,8 @@
mp->m_mode = mode;
#ifdef FEAT_EVAL
mp->m_expr = expr;
- mp->m_script_ID = current_SID;
+ mp->m_script_ctx = current_sctx;
+ mp->m_script_ctx.sc_lnum += sourcing_lnum;
#endif
/* add the new entry in front of the abbrlist or maphash[] list */
@@ -4097,7 +4099,7 @@
}
#ifdef FEAT_EVAL
if (p_verbose > 0)
- last_set_msg(mp->m_script_ID);
+ last_set_msg(mp->m_script_ctx);
#endif
out_flush(); /* show one line at a time */
}