summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVon Random <von@vdrandom.org>2019-04-23 02:40:17 +0300
committerVon Random <von@vdrandom.org>2019-04-23 02:40:17 +0300
commitd7626859f850c9842c70e82c3c78aebf4720034d (patch)
tree436de2b6cb971c58c09ff4e5959d910f40514852
parent2ecdab50ad7ae646e7e7825a4a145658bc329150 (diff)
st-bright-bold-text: 22 should also clear bright
-rw-r--r--st-bright-bold-text.patch21
1 files changed, 16 insertions, 5 deletions
diff --git a/st-bright-bold-text.patch b/st-bright-bold-text.patch
index e18a758..2ab3fc9 100644
--- a/st-bright-bold-text.patch
+++ b/st-bright-bold-text.patch
@@ -13,7 +13,7 @@
static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
diff --git a/st.c b/st.c
-index ede7ae6..e67ef3b 100644
+index ede7ae6..6e3fabe 100644
--- a/st.c
+++ b/st.c
@@ -1351,6 +1351,7 @@ tsetattr(int *attr, int l)
@@ -24,16 +24,27 @@ index ede7ae6..e67ef3b 100644
term.c.attr.mode &= ~(
ATTR_BOLD |
ATTR_FAINT |
-@@ -1365,6 +1366,8 @@ tsetattr(int *attr, int l)
+@@ -1365,6 +1366,9 @@ tsetattr(int *attr, int l)
break;
case 1:
term.c.attr.mode |= ATTR_BOLD;
-+ if (!term.c.attr.colored)
++ if (!term.c.attr.colored) {
+ term.c.attr.fg = defaultbd;
++ }
break;
case 2:
term.c.attr.mode |= ATTR_FAINT;
-@@ -1411,11 +1414,18 @@ tsetattr(int *attr, int l)
+@@ -1391,6 +1395,9 @@ tsetattr(int *attr, int l)
+ break;
+ case 22:
+ term.c.attr.mode &= ~(ATTR_BOLD | ATTR_FAINT);
++ if (!term.c.attr.colored) {
++ term.c.attr.fg = defaultfg;
++ }
+ break;
+ case 23:
+ term.c.attr.mode &= ~ATTR_ITALIC;
+@@ -1411,11 +1418,18 @@ tsetattr(int *attr, int l)
term.c.attr.mode &= ~ATTR_STRUCK;
break;
case 38:
@@ -54,7 +65,7 @@ index ede7ae6..e67ef3b 100644
break;
case 48:
if ((idx = tdefcolor(attr, &i, l)) >= 0)
-@@ -1426,10 +1436,12 @@ tsetattr(int *attr, int l)
+@@ -1426,10 +1440,12 @@ tsetattr(int *attr, int l)
break;
default:
if (BETWEEN(attr[i], 30, 37)) {