rcfile: allow specifying a bright background color (with prefix "light")

If the terminal is capable of more than eight colors, specifying
indexes 8 to 15 works fine for getting a light background color.
master
Benno Schulenberg 2020-06-08 12:31:57 +02:00
parent 4d10f583e4
commit adf7f33ea8
2 changed files with 4 additions and 2 deletions

View File

@ -1031,12 +1031,14 @@ bool parse_combination(char *combostr, short *fg, short *bg, int *attributes)
if (comma != NULL) {
*bg = color_to_short(comma + 1, &vivid, &thick);
if (vivid) {
if (vivid && thick) {
jot_error(N_("A background color cannot be bright"));
return FALSE;
}
if (*bg == BAD_COLOR)
return FALSE;
if (vivid && COLORS > 8)
*bg += 8;
*comma = '\0';
} else
*bg = USE_THE_DEFAULT;

View File

@ -21,7 +21,7 @@ color green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|f
color brightmagenta "([[:space:]]|(start|end)=)".+"([[:space:]]|$)"
# Colors
color yellow "^[[:space:]]*i?color[[:space:]]*(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
color yellow "^[[:space:]]*i?color[[:space:]]*(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
color magenta "^[[:space:]]*i?color\>" "\<(start|end)="
# Comments