diff options
Diffstat (limited to 'src/nvim/option_defs.h')
-rw-r--r-- | src/nvim/option_defs.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 7d5cf3aabe..970615535e 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -17,16 +17,17 @@ typedef enum { kOptValTypeString, } OptValType; +typedef union { + // boolean options are actually tri-states because they have a third "None" value. + TriState boolean; + OptInt number; + String string; +} OptValData; + /// Option value typedef struct { OptValType type; - - union { - // boolean options are actually tri-states because they have a third "None" value. - TriState boolean; - OptInt number; - String string; - } data; + OptValData data; } OptVal; /// :set operator types @@ -46,19 +47,10 @@ typedef struct { int os_idx; int os_flags; - /// old value of the option (can be a string, number or a boolean) - union { - const OptInt number; - const bool boolean; - const char *string; - } os_oldval; - - /// new value of the option (can be a string, number or a boolean) - union { - const OptInt number; - const bool boolean; - const char *string; - } os_newval; + /// Old value of the option. + OptValData os_oldval; + /// New value of the option. + OptValData os_newval; /// When set by the called function: Stop processing the option further. /// Currently only used for boolean options. |