nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit adf7f33ea81e19645a7c2c320a3d39f1337fbe31
parent 4d10f583e466ca46d9f2a4724307b8287478e4b2
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon,  8 Jun 2020 12:31:57 +0200

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.

Diffstat:
Msrc/rcfile.c | 4+++-
Msyntax/nanorc.nanorc | 2+-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -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; diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc @@ -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