summaryrefslogtreecommitdiffstats
path: root/src/vim.h
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-02-20 12:16:39 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-20 12:16:39 +0000
commitaf93691b53f38784efce0b93fe7644c44a7e382e (patch)
tree74e8f31e222aed907e80c4dc5b0bded5f7400537 /src/vim.h
parent997b8a015cd39141866e953651d55c705275cbd6 (diff)
patch 9.0.1330: handling new value of an option has a long "else if" chainv9.0.1330
Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes #12015)
Diffstat (limited to 'src/vim.h')
-rw-r--r--src/vim.h6
1 files changed, 6 insertions, 0 deletions
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"