aboutsummaryrefslogtreecommitdiffstats
path: root/config/style.go
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 /config/style.go
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>
Diffstat (limited to 'config/style.go')
-rw-r--r--config/style.go14
1 files changed, 13 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
}