aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/highlight_defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/highlight_defs.h')
-rw-r--r--src/nvim/highlight_defs.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h
index 3518c8bdcc..09d20c75ea 100644
--- a/src/nvim/highlight_defs.h
+++ b/src/nvim/highlight_defs.h
@@ -8,6 +8,8 @@
typedef int32_t RgbValue;
/// Highlighting attribute bits.
+///
+/// sign bit should not be used here, as it identifies invalid highlight
typedef enum {
HL_INVERSE = 0x01,
HL_BOLD = 0x02,
@@ -35,6 +37,17 @@ typedef struct attr_entry {
.cterm_bg_color = 0, \
}
+// sentinel value that compares unequal to any valid highlight
+#define HLATTRS_INVALID (HlAttrs) { \
+ .rgb_ae_attr = -1, \
+ .cterm_ae_attr = -1, \
+ .rgb_fg_color = -1, \
+ .rgb_bg_color = -1, \
+ .rgb_sp_color = -1, \
+ .cterm_fg_color = 0, \
+ .cterm_bg_color = 0, \
+}
+
/// Values for index in highlight_attr[].
/// When making changes, also update hlf_names below!
typedef enum {
@@ -152,4 +165,19 @@ EXTERN RgbValue normal_fg INIT(= -1);
EXTERN RgbValue normal_bg INIT(= -1);
EXTERN RgbValue normal_sp INIT(= -1);
+typedef enum {
+ kHlUnknown,
+ kHlUI,
+ kHlSyntax,
+ kHlTerminal,
+ kHlCombine,
+} HlKind;
+
+typedef struct {
+ HlAttrs attr;
+ HlKind kind;
+ int id1;
+ int id2;
+} HlEntry;
+
#endif // NVIM_HIGHLIGHT_DEFS_H