nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/4] rcfile: introduce the modifier "bold", for specifying boldin


From: Benno Schulenberg
Subject: [PATCH 3/4] rcfile: introduce the modifier "bold", for specifying bolding separately
Date: Thu, 11 Jun 2020 20:02:51 +0200

This makes it possible to avoid the confusing prefix "bright".  It is
confusing because (on terminal emulators) it not only makes the color
brighter but also the typeface bold.  Now the prefix "lit" will only
make the color brigther, and the modifier "bold" will only make the
typeface bold (on terminal emulators -- on a Linux console, which is
not capable of bold, "bold" will still make the color brighter; thus
it is synonymous with "lit" there; it can't be helped).

This mostly fulfills https://savannah.gnu.org/bugs/?58503.
---
 src/rcfile.c         | 10 ++++++++++
 syntax/nanorc.nanorc |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/rcfile.c b/src/rcfile.c
index 29a4e962..725c4ecb 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -1029,6 +1029,16 @@ bool parse_combination(char *combostr, short *fg, short 
*bg, int *attributes)
 
        *attributes = A_NORMAL;
 
+       if (strncmp(combostr, "bold", 4) == 0) {
+               *attributes = A_BOLD;
+               if (combostr[4] != ',') {
+                       jot_error(N_("An attribute requires a subsequent 
comma"));
+                       return FALSE;
+               }
+               combostr += 5;
+               comma = strchr(combostr, ',');
+       }
+
        if (comma != NULL) {
                *bg = color_to_short(comma + 1, &vivid, &thick);
                if (vivid && thick) {
diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc
index 3c6d217b..351638e0 100644
--- 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|lit)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(lit)?(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
+color yellow 
"^[[:space:]]*i?color[[:space:]]*(bright|(bold,)?(lit)?)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(high)?(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
 color magenta "^[[:space:]]*i?color\>" "\<(start|end)="
 
 # Comments
-- 
2.25.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]