diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-11-03 16:52:20 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-11-03 16:58:22 +0800 |
commit | 981fa11c91d3655828b4f70ccf7d079d917d5b6b (patch) | |
tree | fc0e5caebf9d3af58106092d27d3c0f20d4212ef /src | |
parent | 99acc9de559a2ea3b9de2b418dbcae774d1d9a75 (diff) | |
download | rneovim-981fa11c91d3655828b4f70ccf7d079d917d5b6b.tar.gz rneovim-981fa11c91d3655828b4f70ccf7d079d917d5b6b.tar.bz2 rneovim-981fa11c91d3655828b4f70ccf7d079d917d5b6b.zip |
vim-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: vim/vim#15981
https://github.com/vim/vim/commit/46dcd84d242db6b053cb5b777c896cede9ad9b27
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/optionstr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 307c4ae79f..48423a1779 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -655,6 +655,9 @@ const char *did_set_backupcopy(optset_T *args) if (opt_flags & OPT_LOCAL) { bkc = buf->b_p_bkc; flags = &buf->b_bkc_flags; + } else if (!(opt_flags & OPT_GLOBAL)) { + // When using :set, clear the local flags. + buf->b_bkc_flags = 0; } if ((opt_flags & OPT_LOCAL) && *bkc == NUL) { @@ -1070,6 +1073,9 @@ const char *did_set_completeopt(optset_T *args FUNC_ATTR_UNUSED) if (args->os_flags & OPT_LOCAL) { cot = buf->b_p_cot; flags = &buf->b_cot_flags; + } else if (!(args->os_flags & OPT_GLOBAL)) { + // When using :set, clear the local flags. + buf->b_cot_flags = 0; } if (check_opt_strings(cot, p_cot_values, true) != OK) { |