From af93691b53f38784efce0b93fe7644c44a7e382e Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Mon, 20 Feb 2023 12:16:39 +0000 Subject: 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 #12015) --- src/vim.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vim.h') diff --git a/src/vim.h b/src/vim.h index 45b5fa925c..db38da2e84 100644 --- a/src/vim.h +++ b/src/vim.h @@ -2284,6 +2284,12 @@ typedef enum { FCERR_FAILED, // error while executing the function } funcerror_T; +/* + * Type for the callback function that is invoked after an option value is + * changed to validate and apply the new value. + */ +typedef char *(*opt_did_set_cb_T)(optset_T *args); + // Flags for assignment functions. #define ASSIGN_VAR 0 // ":var" (nothing special) #define ASSIGN_FINAL 0x01 // ":final" -- cgit v1.2.3