forked from aniani/vim
patch 8.1.0515: reloading a script gives errors for existing functions
Problem: Reloading a script gives errors for existing functions. Solution: Allow redefining a function once when reloading a script.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user