summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-21 11:59:32 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-21 11:59:32 +0200
commit3f3fb0b14734272e7c817020c847aaa0fba5cea5 (patch)
tree3b8e280f2ab81d97c5391da1baee228b5138baae
parent933bef779a4da4180f9212039363236ff68a33bc (diff)
patch 8.1.0414: v:option_old is cleared when using :set in OptionSet autocmdv8.1.0414
Problem: v:option_old and v:option_new are cleared when using :set in OptionSet autocmd. (Gary Johnson) Solution: Don't trigger OptionSet recursively.
-rw-r--r--src/option.c11
-rw-r--r--src/version.c2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index 818e6911cd..763aab07a6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4359,7 +4359,9 @@ trigger_optionsset_string(
char_u *oldval,
char_u *newval)
{
- if (oldval != NULL && newval != NULL)
+ // Don't do this recursively.
+ if (oldval != NULL && newval != NULL
+ && *get_vim_var_str(VV_OPTION_TYPE) == NUL)
{
char_u buf_type[7];
@@ -8858,9 +8860,11 @@ set_bool_option(
options[opt_idx].flags |= P_WAS_SET;
#if defined(FEAT_EVAL)
- if (!starting)
+ // Don't do this while starting up or recursively.
+ if (!starting && *get_vim_var_str(VV_OPTION_TYPE) == NUL)
{
char_u buf_old[2], buf_new[2], buf_type[7];
+
vim_snprintf((char *)buf_old, 2, "%d", old_value ? TRUE: FALSE);
vim_snprintf((char *)buf_new, 2, "%d", value ? TRUE: FALSE);
vim_snprintf((char *)buf_type, 7, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global");
@@ -9415,7 +9419,8 @@ set_num_option(
options[opt_idx].flags |= P_WAS_SET;
#if defined(FEAT_EVAL)
- if (!starting && errmsg == NULL)
+ // Don't do this while starting up, failure or recursively.
+ if (!starting && errmsg == NULL && *get_vim_var_str(VV_OPTION_TYPE) == NUL)
{
char_u buf_old[11], buf_new[11], buf_type[7];
vim_snprintf((char *)buf_old, 10, "%ld", old_value);
diff --git a/src/version.c b/src/version.c
index 0e20abf55a..3ce73b9ea2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 414,
+/**/
413,
/**/
412,