From f29c1c6aa3f365c025890fab5fb9efbe88eb1761 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 10 Sep 2018 21:05:02 +0200 Subject: 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". --- src/getchar.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/getchar.c') diff --git a/src/getchar.c b/src/getchar.c index 496e33fa86..cc8b344e11 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3677,7 +3677,8 @@ do_map( 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 @@ do_map( 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 @@ showmap( } #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 */ } -- cgit v1.2.3