summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/option.c b/src/option.c
index af9fb506fc..5e8e95a6d2 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5742,15 +5742,21 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
flags = &curbuf->b_bkc_flags;
}
- if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK)
- errmsg = e_invarg;
- if ((((int)*flags & BKC_AUTO) != 0)
- + (((int)*flags & BKC_YES) != 0)
- + (((int)*flags & BKC_NO) != 0) != 1)
+ if ((opt_flags & OPT_LOCAL) && *bkc == NUL)
+ /* make the local value empty: use the global value */
+ *flags = 0;
+ else
{
- /* Must have exactly one of "auto", "yes" and "no". */
- (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE);
- errmsg = e_invarg;
+ if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK)
+ errmsg = e_invarg;
+ if ((((int)*flags & BKC_AUTO) != 0)
+ + (((int)*flags & BKC_YES) != 0)
+ + (((int)*flags & BKC_NO) != 0) != 1)
+ {
+ /* Must have exactly one of "auto", "yes" and "no". */
+ (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE);
+ errmsg = e_invarg;
+ }
}
}