summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-09-13 15:17:41 -0400
committerJune McEnroe <june@causal.agency>2018-09-13 15:17:41 -0400
commit9a69869d392ca9ac9e2d845dec5f4dfecdbf3456 (patch)
tree7179e65680da647300158cf2eb0549f593e20030 /ui.c
parentReturn a format->split even at the end of the string (diff)
downloadcatgirl-9a69869d392ca9ac9e2d845dec5f4dfecdbf3456.tar.gz
catgirl-9a69869d392ca9ac9e2d845dec5f4dfecdbf3456.zip
Add IRCDefault to colors enum
Diffstat (limited to '')
-rw-r--r--ui.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui.c b/ui.c
index c9210c6..54f0492 100644
--- a/ui.c
+++ b/ui.c
@@ -160,7 +160,7 @@ void uiDraw(void) {
 	doupdate();
 }
 
-static const short IRCColors[] = {
+static const short Colors[] = {
 	[IRCWhite]      = 8 + COLOR_WHITE,
 	[IRCBlack]      = 0 + COLOR_BLACK,
 	[IRCBlue]       = 0 + COLOR_BLUE,
@@ -187,8 +187,8 @@ static void addFormat(WINDOW *win, const struct Format *format) {
 	if (format->reverse)   attr |= A_REVERSE;
 
 	short pair = -1;
-	if (format->fg >= 0) pair = IRCColors[format->fg];
-	if (format->bg >= 0) pair |= IRCColors[format->bg] << 4;
+	if (format->fg != IRCDefault) pair = Colors[format->fg];
+	if (format->bg != IRCDefault) pair |= Colors[format->bg] << 4;
 
 	wattr_set(win, attr | attr8(pair), 1 + pair8(pair), NULL);
 	waddnwstr(win, format->str, format->len);