From 3907a8d92145ae6a8dea521c502281ca1fd2dbab Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 17 Oct 2020 00:37:51 +0200 Subject: [PATCH] Improved the new Style.Attributes() function. (Should not modify the existing Style object.) --- style.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/style.go b/style.go index 03d6a05..4fdb5e0 100644 --- a/style.go +++ b/style.go @@ -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, + } }