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
parent
4d10f583e4
commit
adf7f33ea8
|
@ -1031,12 +1031,14 @@ bool parse_combination(char *combostr, short *fg, short *bg, int *attributes)
|
||||||
|
|
||||||
if (comma != NULL) {
|
if (comma != NULL) {
|
||||||
*bg = color_to_short(comma + 1, &vivid, &thick);
|
*bg = color_to_short(comma + 1, &vivid, &thick);
|
||||||
if (vivid) {
|
if (vivid && thick) {
|
||||||
jot_error(N_("A background color cannot be bright"));
|
jot_error(N_("A background color cannot be bright"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (*bg == BAD_COLOR)
|
if (*bg == BAD_COLOR)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
if (vivid && COLORS > 8)
|
||||||
|
*bg += 8;
|
||||||
*comma = '\0';
|
*comma = '\0';
|
||||||
} else
|
} else
|
||||||
*bg = USE_THE_DEFAULT;
|
*bg = USE_THE_DEFAULT;
|
||||||
|
|
|
@ -21,7 +21,7 @@ color green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|f
|
||||||
color brightmagenta "([[:space:]]|(start|end)=)".+"([[:space:]]|$)"
|
color brightmagenta "([[:space:]]|(start|end)=)".+"([[:space:]]|$)"
|
||||||
|
|
||||||
# Colors
|
# 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)="
|
color magenta "^[[:space:]]*i?color\>" "\<(start|end)="
|
||||||
|
|
||||||
# Comments
|
# Comments
|
||||||
|
|
Loading…
Reference in New Issue