aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-11-07 11:37:08 -0600
committerRobin Jarry <robin@jarry.cc>2022-11-09 21:38:41 +0100
commitce5fadc2dddd7641ffd1985c95f7933cde58e5b9 (patch)
tree471d88b6b53b21561f13bcadefce2ec3d5e7bdba
parent86c612e48025104b32b2048fead1248a3d3b1c8f (diff)
downloadaerc-ce5fadc2dddd7641ffd1985c95f7933cde58e5b9.tar.gz
style: add italic option
Add italic option to style config. Update docs. Suggested-by: inwit <inwit@sindominio.net> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
-rw-r--r--config/style.go14
-rw-r--r--doc/aerc-stylesets.7.scd6
2 files changed, 19 insertions, 1 deletions
diff --git a/config/style.go b/config/style.go
index d8da4c7f..30351a24 100644
--- a/config/style.go
+++ b/config/style.go
@@ -103,6 +103,7 @@ type Style struct {
Blink bool
Underline bool
Reverse bool
+ Italic bool
}
func (s Style) Get() tcell.Style {
@@ -112,7 +113,8 @@ func (s Style) Get() tcell.Style {
Bold(s.Bold).
Blink(s.Blink).
Underline(s.Underline).
- Reverse(s.Reverse)
+ Reverse(s.Reverse).
+ Italic(s.Italic)
}
func (s *Style) Normal() {
@@ -120,6 +122,7 @@ func (s *Style) Normal() {
s.Blink = false
s.Underline = false
s.Reverse = false
+ s.Italic = false
}
func (s *Style) Default() *Style {
@@ -189,6 +192,12 @@ func (s *Style) Set(attr, val string) error {
} else {
s.Reverse = state
}
+ case "italic":
+ if state, err := boolSwitch(val, s.Italic); err != nil {
+ return err
+ } else {
+ s.Italic = state
+ }
case "default":
s.Default()
case "normal":
@@ -221,6 +230,9 @@ func (s Style) composeWith(styles []*Style) Style {
if st.Reverse != s.Reverse {
newStyle.Reverse = st.Reverse
}
+ if st.Italic != s.Italic {
+ newStyle.Italic = st.Italic
+ }
}
return newStyle
}
diff --git a/doc/aerc-stylesets.7.scd b/doc/aerc-stylesets.7.scd
index 8aac6c49..acd5ac7c 100644
--- a/doc/aerc-stylesets.7.scd
+++ b/doc/aerc-stylesets.7.scd
@@ -56,6 +56,12 @@ style objects.
Syntax: `<style_object>.underline=<true|false|toggle>`
+*italic*
+ The italic attribute of the style object is set/unset.
+ _The terminal needs to support italic text_
+
+ Syntax: `<style_object>.italic=<true|false|toggle>`
+
*reverse*
Reverses the color of the style object. Exchanges the foreground
and background colors.