Remove setting for underlining and striking whitespace

This commit is contained in:
Christian Rocha 2021-03-26 10:36:23 -04:00
parent a3ab90a71c
commit a47a89f4ae
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
4 changed files with 3 additions and 46 deletions

View File

@ -42,8 +42,8 @@ func (c Color) value() string {
return string(c)
}
// AdaptiveColor provides color alternatives for light and dark backgrounds.
// The appropriate color with be returned based on the darkness of the terminal
// AdaptiveColor provides color options for light and dark backgrounds. The
// appropriate color with be returned based on the darkness of the terminal
// background color determined at runtime.
//
// Example usage:

18
set.go
View File

@ -466,24 +466,6 @@ func (s Style) MaxHeight(n int) Style {
return o
}
// UnderlineWhitespace determines whether to draw underlines in areas outside
// text blocks. By default this is false, but it can be enabled for certain
// graphic effects. Also note that whitespace can be underlined without
// underlining text.
func (s Style) UnderlineWhitespace(v bool) Style {
s.set(underlineWhitespaceKey, v)
return s
}
// StrikethroughWhitespace determines whether to draw strikethroughs in areas
// outside text blocks. By default this is false, but it can be enabled for
// certain graphic effects. Also note that whitespace can be struck without
// striking through text.
func (s Style) StrikethroughWhitespace(v bool) Style {
s.set(strikethroughWhitespaceKey, v)
return s
}
// UnderlineSpaces determines whether to underline spaces between words. By
// default this is true. Spaces can also be underlined without underlining the
// text itself.

View File

@ -52,8 +52,6 @@ const (
inlineKey
maxWidthKey
maxHeightKey
underlineWhitespaceKey
strikethroughWhitespaceKey
underlineSpacesKey
strikethroughSpacesKey
)
@ -162,15 +160,12 @@ func (s Style) Render(str string) string {
maxWidth = s.getAsInt(maxWidthKey)
maxHeight = s.getAsInt(maxHeightKey)
underlineWhitespace = s.getAsBool(underlineWhitespaceKey, false)
strikethroughWhitespace = s.getAsBool(strikethroughWhitespaceKey, false)
underlineSpaces = underline && s.getAsBool(underlineSpacesKey, true)
strikethroughSpaces = strikethrough && s.getAsBool(strikethroughSpacesKey, true)
// Do we need to style whitespace (padding and space outsode
// paragraphs) separately?
styleWhitespace = reverse || underlineWhitespace || strikethroughWhitespace
styleWhitespace = reverse
// Do we need to style spaces separately?
useSpaceStyler = underlineSpaces || strikethroughSpaces
@ -228,12 +223,6 @@ func (s Style) Render(str string) string {
te = te.CrossOut()
}
if underlineWhitespace {
teWhitespace = teWhitespace.Underline()
}
if strikethroughWhitespace {
teWhitespace = teWhitespace.CrossOut()
}
if underlineSpaces {
teSpace = teSpace.Underline()
}

View File

@ -275,20 +275,6 @@ func (s Style) UnsetMaxHeight() Style {
return s
}
// UnsetUnderlineWhitespace removes the rule for underlining whitespace, if
// set.
func (s Style) UnsetUnderlineWhitespace() Style {
delete(s.rules, underlineSpacesKey)
return s
}
// UnsetUnderlineWhitespace removes the rule for strikingn through whitespace,
// if set.
func (s Style) UnsetStrikethroughWhitespace() Style {
delete(s.rules, strikethroughSpacesKey)
return s
}
// UnsetUnderlineSpaces removes the value set by UnderlineSpaces.
func (s Style) UnsetUnderlineSpaces() Style {
delete(s.rules, underlineSpacesKey)