patch 8.0.1359: libvterm ANSI colors can not always be recognized
Problem: Libvterm ANSI colors can not always be recognized from the RGB
values. The default color is wrong when t_RB is empty.
Solution: Add the ANSI color index to VTermColor.
diff --git a/src/libvterm/include/vterm.h b/src/libvterm/include/vterm.h
index 50a840a..f731dcb 100644
--- a/src/libvterm/include/vterm.h
+++ b/src/libvterm/include/vterm.h
@@ -79,8 +79,16 @@
}
#endif
+/* The ansi_index is used for the lower 16 colors, which can be set to any
+ * color. */
+#define VTERM_ANSI_INDEX_DEFAULT 0 /* color cleared */
+#define VTERM_ANSI_INDEX_MIN 1
+#define VTERM_ANSI_INDEX_MAX 16
+#define VTERM_ANSI_INDEX_NONE 255 /* non-ANSI color, use red/green/blue */
+
typedef struct {
uint8_t red, green, blue;
+ uint8_t ansi_index;
} VTermColor;
typedef enum {