0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

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)
This commit is contained in:
Yegappan Lakshmanan
2023-02-20 12:16:39 +00:00
committed by Bram Moolenaar
parent 997b8a015c
commit af93691b53
37 changed files with 1517 additions and 1509 deletions

View File

@@ -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"