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)
diff --git a/src/vim.h b/src/vim.h
index 45b5fa9..db38da2 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -2284,6 +2284,12 @@
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"