From ff34c91194f9ab9d02808f2880029c38a4655eb5 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 17 Apr 2023 17:23:47 +0100 Subject: vim-patch:9.0.1330: handling new value of an option has a long "else if" chain Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes vim/vim#12015) https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e --- src/nvim/ops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/ops.c') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 2919b94d41..89fe9b464d 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -5628,11 +5628,12 @@ static void op_colon(oparg_T *oap) static Callback opfunc_cb; /// Process the 'operatorfunc' option value. -void set_operatorfunc_option(const char **errmsg) +const char *did_set_operatorfunc(optset_T *args FUNC_ATTR_UNUSED) { if (option_set_callback_func(p_opfunc, &opfunc_cb) == FAIL) { - *errmsg = e_invarg; + return e_invarg; } + return NULL; } #if defined(EXITFREE) -- cgit