diff options
author | erw7 <erw7.github@gmail.com> | 2019-08-29 13:07:03 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2019-09-04 13:40:05 +0900 |
commit | 9db60b06a1d9b50b3ba6beb858eb0fd2c58571c4 (patch) | |
tree | bd7d55a5af91afae726345b7fc40324625241879 /src/nvim/ex_cmds2.c | |
parent | e4a47862415ee6e0c4904f9c5cc8c3453be6bf17 (diff) | |
download | rneovim-9db60b06a1d9b50b3ba6beb858eb0fd2c58571c4.tar.gz rneovim-9db60b06a1d9b50b3ba6beb858eb0fd2c58571c4.tar.bz2 rneovim-9db60b06a1d9b50b3ba6beb858eb0fd2c58571c4.zip |
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.
https://github.com/vim/vim/commit/ded5f1bed7ff2d138b3ee0f9610d17290b62692d
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 96f758805b..964b884460 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -3034,6 +3034,7 @@ int do_source(char_u *fname, int check_other, int is_vimrc) char_u *firstline = NULL; int retval = FAIL; static scid_T last_current_SID = 0; + static int last_current_SID_seq = 0; void *save_funccalp; int save_debug_break_level = debug_break_level; scriptitem_T *si = NULL; @@ -3160,7 +3161,9 @@ int do_source(char_u *fname, int check_other, int is_vimrc) // 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. const sctx_T save_current_sctx = current_sctx; + current_sctx.sc_seq = ++last_current_SID_seq; current_sctx.sc_lnum = 0; FileID file_id; bool file_id_ok = os_fileid((char *)fname_exp, &file_id); |