Use 8 for underscore colour defaults instead of 0 which is less

confusing, and fix writing tge default colour. GitHub issue 3627.
This commit is contained in:
nicm
2023-07-13 06:03:48 +00:00
parent 8fcc212e7a
commit 84936b832f
3 changed files with 10 additions and 9 deletions

7
tty.c
View File

@ -2815,9 +2815,10 @@ tty_check_us(__unused struct tty *tty, struct colour_palette *palette,
}
/* Underscore colour is set as RGB so convert. */
gc->us = colour_force_rgb (gc->us);
if (gc->us == -1)
if ((c = colour_force_rgb (gc->us)) == -1)
gc->us = 8;
else
gc->us = c;
}
static void
@ -2892,7 +2893,7 @@ tty_colours_us(struct tty *tty, const struct grid_cell *gc)
u_char r, g, b;
/* Clear underline colour. */
if (gc->us == 0) {
if (COLOUR_DEFAULT(gc->us)) {
tty_putcode(tty, TTYC_OL);
goto save;
}