diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-11-10 17:33:29 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-11-10 17:33:29 +0100 |
commit | ded5f1bed7ff2d138b3ee0f9610d17290b62692d (patch) | |
tree | 54727bd70279df4fadc4b8f4701577ac33282ef5 /src/ex_cmds2.c | |
parent | 1bbb61948342b5cf6e363629f145c65eb455c388 (diff) | |
download | vim-git-ded5f1bed7ff2d138b3ee0f9610d17290b62692d.tar.gz |
patch 8.1.0515: reloading a script gives errors for existing functionsv8.1.0515
Problem: Reloading a script gives errors for existing functions.
Solution: Allow redefining a function once when reloading a script.
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 3a4bce8a2..d6b6f5bf8 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); |