aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-08-29 13:07:03 +0900
committererw7 <erw7.github@gmail.com>2019-09-04 13:40:05 +0900
commit9db60b06a1d9b50b3ba6beb858eb0fd2c58571c4 (patch)
treebd7d55a5af91afae726345b7fc40324625241879 /src/nvim/option.c
parente4a47862415ee6e0c4904f9c5cc8c3453be6bf17 (diff)
downloadrneovim-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/option.c')
-rw-r--r--src/nvim/option.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index c7d2dcb602..ae75644794 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -200,7 +200,7 @@ typedef struct vimoption {
// local option: indirect option index
char_u *def_val[2]; // default values for variable (vi and vim)
LastSet last_set; // script in which the option was last set
-# define SCTX_INIT , { 0, 0 }
+# define SCTX_INIT , { 0, 0, 0 }
} vimoption_T;
#define VI_DEFAULT 0 // def_val[VI_DEFAULT] is Vi default value
@@ -2423,6 +2423,7 @@ set_string_option_direct(
script_ctx = current_sctx;
} else {
script_ctx.sc_sid = set_sid;
+ script_ctx.sc_seq = 0;
script_ctx.sc_lnum = 0;
}
set_option_sctx_idx(idx, opt_flags, script_ctx);
@@ -3798,7 +3799,8 @@ static void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx)
int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
int indir = (int)options[opt_idx].indir;
const LastSet last_set = { .script_ctx =
- { script_ctx.sc_sid, script_ctx.sc_lnum + sourcing_lnum },
+ { script_ctx.sc_sid, script_ctx.sc_seq,
+ script_ctx.sc_lnum + sourcing_lnum },
current_channel_id };
// Remember where the option was set. For local options need to do that