1
0
mirror of https://github.com/gdamore/tcell.git synced 2025-04-24 13:48:51 +08:00

Improved the new Style.Attributes() function. (Should not modify the existing Style object.)

This commit is contained in:
Oliver 2020-10-17 00:37:51 +02:00 committed by Garrett D'Amore
parent 1575526e4d
commit 3907a8d921

View File

@ -129,6 +129,9 @@ func (s Style) StrikeThrough(on bool) Style {
// Attributes returns a new style based on s, with its attributes set as
// specified.
func (s Style) Attributes(attrs AttrMask) Style {
s.attrs = attrs
return s
return Style{
fg: s.fg,
bg: s.fg,
attrs: attrs,
}
}