0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 9.1.0832: :set doesn't work for 'cot' and 'bkc' after :setlocal

Problem:  :set doesn't work for 'cot' and 'bkc' after :setlocal.
Solution: clear the local flags when using :set (zeertzjq).

closes: #15981

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-11-03 09:10:50 +01:00
committed by Christian Brabandt
parent 6081c17890
commit 46dcd84d24
3 changed files with 48 additions and 0 deletions

View File

@@ -1146,6 +1146,9 @@ did_set_backupcopy(optset_T *args)
bkc = curbuf->b_p_bkc;
flags = &curbuf->b_bkc_flags;
}
else if (!(args->os_flags & OPT_GLOBAL))
// When using :set, clear the local flags.
curbuf->b_bkc_flags = 0;
if ((args->os_flags & OPT_LOCAL) && *bkc == NUL)
// make the local value empty: use the global value
@@ -1619,6 +1622,9 @@ did_set_completeopt(optset_T *args UNUSED)
cot = curbuf->b_p_cot;
flags = &curbuf->b_cot_flags;
}
else if (!(args->os_flags & OPT_GLOBAL))
// When using :set, clear the local flags.
curbuf->b_cot_flags = 0;
if (check_opt_strings(cot, p_cot_values, TRUE) != OK)
return e_invalid_argument;