summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-10 21:05:02 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-10 21:05:02 +0200
commitf29c1c6aa3f365c025890fab5fb9efbe88eb1761 (patch)
tree3cd43ee75a7e0fbdce4902426512ae804b1c7ff0 /src/main.c
parent6b0b83f768cf536b34ce4d3f2de6bf62324229aa (diff)
downloadvim-git-f29c1c6aa3f365c025890fab5fb9efbe88eb1761.tar.gz
patch 8.1.0362: cannot get the script line number when executing a functionv8.1.0362
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".
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index d3a509be3..cb0676ce5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2912,13 +2912,13 @@ exe_pre_commands(mparm_T *parmp)
curwin->w_cursor.lnum = 0; /* just in case.. */
sourcing_name = (char_u *)_("pre-vimrc command line");
# ifdef FEAT_EVAL
- current_SID = SID_CMDARG;
+ current_sctx.sc_sid = SID_CMDARG;
# endif
for (i = 0; i < cnt; ++i)
do_cmdline_cmd(cmds[i]);
sourcing_name = NULL;
# ifdef FEAT_EVAL
- current_SID = 0;
+ current_sctx.sc_sid = 0;
# endif
TIME_MSG("--cmd commands");
}
@@ -2942,7 +2942,7 @@ exe_commands(mparm_T *parmp)
curwin->w_cursor.lnum = 0;
sourcing_name = (char_u *)"command line";
#ifdef FEAT_EVAL
- current_SID = SID_CARG;
+ current_sctx.sc_sid = SID_CARG;
#endif
for (i = 0; i < parmp->n_commands; ++i)
{
@@ -2952,7 +2952,7 @@ exe_commands(mparm_T *parmp)
}
sourcing_name = NULL;
#ifdef FEAT_EVAL
- current_SID = 0;
+ current_sctx.sc_sid = 0;
#endif
if (curwin->w_cursor.lnum == 0)
curwin->w_cursor.lnum = 1;
@@ -3159,7 +3159,7 @@ process_env(
char_u *save_sourcing_name;
linenr_T save_sourcing_lnum;
#ifdef FEAT_EVAL
- scid_T save_sid;
+ sctx_T save_current_sctx;
#endif
if ((initstr = mch_getenv(env)) != NULL && *initstr != NUL)
@@ -3171,14 +3171,15 @@ process_env(
sourcing_name = env;
sourcing_lnum = 0;
#ifdef FEAT_EVAL
- save_sid = current_SID;
- current_SID = SID_ENV;
+ save_current_sctx = current_sctx;
+ current_sctx.sc_sid = SID_ENV;
+ current_sctx.sc_lnum = 0;
#endif
do_cmdline_cmd(initstr);
sourcing_name = save_sourcing_name;
sourcing_lnum = save_sourcing_lnum;
#ifdef FEAT_EVAL
- current_SID = save_sid;
+ current_sctx = save_current_sctx;
#endif
return OK;
}