aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 48fd797ee9..a2120b9ab4 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -196,7 +196,7 @@ typedef struct vimoption {
idopt_T indir; /* global option: PV_NONE;
* local option: indirect option index */
char_u *def_val[2]; /* default values for variable (vi and vim) */
- scid_T scriptID; /* script in which the option was last set */
+ LastSet last_set; /* script in which the option was last set */
# define SCRIPTID_INIT , 0
} vimoption_T;
@@ -1368,12 +1368,12 @@ do_set (
if (p_verbose > 0) {
/* Mention where the option was last set. */
if (varp == options[opt_idx].var)
- last_set_msg(options[opt_idx].scriptID);
+ option_last_set_msg(options[opt_idx].last_set);
else if ((int)options[opt_idx].indir & PV_WIN)
- last_set_msg(curwin->w_p_scriptID[
+ option_last_set_msg(curwin->w_p_scriptID[
(int)options[opt_idx].indir & PV_MASK]);
else if ((int)options[opt_idx].indir & PV_BUF)
- last_set_msg(curbuf->b_p_scriptID[
+ option_last_set_msg(curbuf->b_p_scriptID[
(int)options[opt_idx].indir & PV_MASK]);
}
} else {
@@ -3663,16 +3663,18 @@ static void set_option_scriptID_idx(int opt_idx, int opt_flags, int id)
{
int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
int indir = (int)options[opt_idx].indir;
+ const LastSet last_set = { id, current_channel_id };
/* Remember where the option was set. For local options need to do that
* in the buffer or window structure. */
- if (both || (opt_flags & OPT_GLOBAL) || (indir & (PV_BUF|PV_WIN)) == 0)
- options[opt_idx].scriptID = id;
+ if (both || (opt_flags & OPT_GLOBAL) || (indir & (PV_BUF|PV_WIN)) == 0) {
+ options[opt_idx].last_set = last_set;
+ }
if (both || (opt_flags & OPT_LOCAL)) {
if (indir & PV_BUF)
- curbuf->b_p_scriptID[indir & PV_MASK] = id;
+ curbuf->b_p_scriptID[indir & PV_MASK] = last_set;
else if (indir & PV_WIN)
- curwin->w_p_scriptID[indir & PV_MASK] = id;
+ curwin->w_p_scriptID[indir & PV_MASK] = last_set;
}
}