diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-11-03 17:46:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-03 17:46:02 +0800 |
commit | 76643a1c0dcd78a99166fa69f837c0fa7331b6aa (patch) | |
tree | fc6c3550d92cbce3da5e2b5552fb46c93663e2a7 /src/nvim/ex_docmd.c | |
parent | 99acc9de559a2ea3b9de2b418dbcae774d1d9a75 (diff) | |
parent | fe565ca382bb6cc4cd9f1c01de42d62c48922bf6 (diff) | |
download | rneovim-76643a1c0dcd78a99166fa69f837c0fa7331b6aa.tar.gz rneovim-76643a1c0dcd78a99166fa69f837c0fa7331b6aa.tar.bz2 rneovim-76643a1c0dcd78a99166fa69f837c0fa7331b6aa.zip |
Merge pull request #31059 from zeertzjq/vim-9.1.0832
vim-patch:9.1.{0832,0835}
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 1c215cd3e1..92695aa4de 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5173,7 +5173,7 @@ static Callback *get_findfunc_callback(void) return *curbuf->b_p_ffu != NUL ? &curbuf->b_ffu_cb : &ffu_cb; } -/// Call 'findfunc' to obtain the list of file names. +/// Call 'findfunc' to obtain a list of file names. static list_T *call_findfunc(char *pat, BoolVarValue cmdcomplete) { const sctx_T saved_sctx = current_sctx; @@ -5294,12 +5294,16 @@ const char *did_set_findfunc(optset_T *args) buf_T *buf = (buf_T *)args->os_buf; int retval; - if (*buf->b_p_ffu != NUL) { + if (args->os_flags & OPT_LOCAL) { // buffer-local option set retval = option_set_callback_func(buf->b_p_ffu, &buf->b_ffu_cb); } else { // global option set retval = option_set_callback_func(p_ffu, &ffu_cb); + // when using :set, free the local callback + if (!(args->os_flags & OPT_GLOBAL)) { + callback_free(&buf->b_ffu_cb); + } } if (retval == FAIL) { |