aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option_defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/option_defs.h')
-rw-r--r--src/nvim/option_defs.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 28718c6269..7ccf09b934 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -8,14 +8,21 @@
#include "nvim/regexp_defs.h"
#include "nvim/types_defs.h"
-/// Option value type
+/// Option value type.
+/// These types are also used as type flags by using the type value as an index for the type_flags
+/// bit field (@see option_has_type()).
typedef enum {
- kOptValTypeNil = 0,
+ kOptValTypeNil = -1, // Make sure Nil can't be bitshifted and used as an option type flag.
kOptValTypeBoolean,
kOptValTypeNumber,
kOptValTypeString,
} OptValType;
+/// Always update this whenever a new option type is added.
+#define kOptValTypeSize (kOptValTypeString + 1)
+
+typedef uint32_t OptTypeFlags;
+
typedef union {
// boolean options are actually tri-states because they have a third "None" value.
TriState boolean;