mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44: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:
committed by
Bram Moolenaar
parent
997b8a015c
commit
af93691b53
@@ -4789,3 +4789,33 @@ typedef struct {
|
||||
#endif
|
||||
int cts_vcol; // virtual column at current position
|
||||
} chartabsize_T;
|
||||
|
||||
/*
|
||||
* Argument for the callback function (opt_did_set_cb_T) invoked after an
|
||||
* option value is modified.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int os_flags;
|
||||
char_u *os_varp; // pointer to the option variable
|
||||
|
||||
// old value of the option (can be a string, number or a boolean)
|
||||
union
|
||||
{
|
||||
long number;
|
||||
int boolean;
|
||||
char_u *string;
|
||||
} os_oldval;
|
||||
|
||||
// new value of the option (can be a string, number or a boolean)
|
||||
union
|
||||
{
|
||||
long number;
|
||||
int boolean;
|
||||
char_u *string;
|
||||
} os_newval;
|
||||
|
||||
// When set by the called function: Stop processing the option further.
|
||||
// Currently only used for boolean options.
|
||||
int os_doskip;
|
||||
} optset_T;
|
||||
|
Reference in New Issue
Block a user