diff options
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r-- | src/ex_cmds2.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 3a4bce8a26..d6b6f5bf89 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -4344,6 +4344,7 @@ do_source( #ifdef FEAT_EVAL sctx_T save_current_sctx; static scid_T last_current_SID = 0; + static int last_current_SID_seq = 0; funccal_entry_T funccalp_entry; int save_debug_break_level = debug_break_level; scriptitem_T *si = NULL; @@ -4508,11 +4509,11 @@ do_source( * Also starts profiling timer for nested script. */ save_funccal(&funccalp_entry); - /* - * Check if this script was sourced before to finds its SID. - * If it's new, generate a new SID. - */ + // Check if this script was sourced before to finds its SID. + // If it's new, generate a new SID. + // Always use a new sequence number. save_current_sctx = current_sctx; + current_sctx.sc_seq = ++last_current_SID_seq; current_sctx.sc_lnum = 0; # ifdef UNIX stat_ok = (mch_stat((char *)fname_exp, &st) >= 0); |