aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorPavel Platto <hinidu@gmail.com>2015-01-20 19:53:10 +0000
committerPavel Platto <hinidu@gmail.com>2015-01-20 21:57:57 +0200
commit2275b9753e27ba4dc171fbba20d50ee8417e5fd1 (patch)
tree914d00bb761849a4b6fba3989a0c3c6cbad55170 /src/nvim/option.c
parentda43f70ba726cc6dfcf3bc8c73b86a5be713cb47 (diff)
downloadrneovim-2275b9753e27ba4dc171fbba20d50ee8417e5fd1.tar.gz
rneovim-2275b9753e27ba4dc171fbba20d50ee8417e5fd1.tar.bz2
rneovim-2275b9753e27ba4dc171fbba20d50ee8417e5fd1.zip
vim-patch:7.4.462
Problem: Setting the local value of 'backupcopy' empty gives an error. (Peter Mattern) Solution: When using an empty value set the flags to zero. (Hirohito Higashi) https://code.google.com/p/vim/source/detail?r=v7-4-462
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index a167363abf..0199c5fc6c 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -3794,16 +3794,21 @@ did_set_string_option (
flags = &curbuf->b_bkc_flags;
}
- if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK) {
- errmsg = e_invarg;
- }
+ if ((opt_flags & OPT_LOCAL) && *bkc == NUL) {
+ // make the local value empty: use the global value
+ *flags = 0;
+ } else {
+ if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK) {
+ errmsg = e_invarg;
+ }
- if (((*flags & BKC_AUTO) != 0)
- + ((*flags & BKC_YES) != 0)
- + ((*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;
+ if (((*flags & BKC_AUTO) != 0)
+ + ((*flags & BKC_YES) != 0)
+ + ((*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;
+ }
}
}
/* 'backupext' and 'patchmode' */