mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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".
This commit is contained in:
17
src/main.c
17
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user