Commit 570fb6c6 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

small addition: understand color name "normal" to mean the default color

This allows a syntax to remove the color from things that were colored
overeagerly by earlier regexes.
parent 1de36675
Showing with 7 additions and 2 deletions
+7 -2
...@@ -602,9 +602,11 @@ short color_to_short(const char *colorname, bool *bright) ...@@ -602,9 +602,11 @@ short color_to_short(const char *colorname, bool *bright)
return COLOR_MAGENTA; return COLOR_MAGENTA;
else if (strcasecmp(colorname, "black") == 0) else if (strcasecmp(colorname, "black") == 0)
return COLOR_BLACK; return COLOR_BLACK;
else if (strcasecmp(colorname, "normal") == 0)
return -1;
rcfile_error(N_("Color \"%s\" not understood"), colorname); rcfile_error(N_("Color \"%s\" not understood"), colorname);
return -1; return -2;
} }
/* Parse the color string in the line at ptr, and add it to the current /* Parse the color string in the line at ptr, and add it to the current
...@@ -753,11 +755,14 @@ bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright) ...@@ -753,11 +755,14 @@ bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright)
*fg = color_to_short(combostr, bright); *fg = color_to_short(combostr, bright);
/* If the specified foreground color is bad, ignore the regexes. */ /* If the specified foreground color is bad, ignore the regexes. */
if (*fg == -1) if (*fg == -2)
return FALSE; return FALSE;
} else } else
*fg = -1; *fg = -1;
if (*bg == -2)
*bg = -1;
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment