mirror of
https://github.com/charmbracelet/lipgloss.git
synced 2024-10-26 22:57:49 +03:00
docs: minor fixes to comments
This commit is contained in:
parent
92c8fa0a57
commit
3dd9f0bfb8
20
get.go
20
get.go
@ -6,42 +6,42 @@ import (
|
||||
"github.com/muesli/reflow/ansi"
|
||||
)
|
||||
|
||||
// GetBold returns the style's bold value It no value is set false is returned.
|
||||
// GetBold returns the style's bold value. If no value is set false is returned.
|
||||
func (s Style) GetBold() bool {
|
||||
return s.getAsBool(boldKey, false)
|
||||
}
|
||||
|
||||
// GetItalic returns the style's italic value. It no value is set false is
|
||||
// GetItalic returns the style's italic value. If no value is set false is
|
||||
// returned.
|
||||
func (s Style) GetItalic() bool {
|
||||
return s.getAsBool(italicKey, false)
|
||||
}
|
||||
|
||||
// GetUnderline returns the style's underline value. It no value is set false is
|
||||
// GetUnderline returns the style's underline value. If no value is set false is
|
||||
// returned.
|
||||
func (s Style) GetUnderline() bool {
|
||||
return s.getAsBool(underlineKey, false)
|
||||
}
|
||||
|
||||
// GetStrikethrough returns the style's strikethrough value. It no value is set false
|
||||
// GetStrikethrough returns the style's strikethrough value. If no value is set false
|
||||
// is returned.
|
||||
func (s Style) GetStrikethrough() bool {
|
||||
return s.getAsBool(strikethroughKey, false)
|
||||
}
|
||||
|
||||
// GetReverse returns the style's reverse value. It no value is set false is
|
||||
// GetReverse returns the style's reverse value. If no value is set false is
|
||||
// returned.
|
||||
func (s Style) GetReverse() bool {
|
||||
return s.getAsBool(reverseKey, false)
|
||||
}
|
||||
|
||||
// GetBlink returns the style's blink value. It no value is set false is
|
||||
// GetBlink returns the style's blink value. If no value is set false is
|
||||
// returned.
|
||||
func (s Style) GetBlink() bool {
|
||||
return s.getAsBool(blinkKey, false)
|
||||
}
|
||||
|
||||
// GetFaint returns the style's faint value. It no value is set false is
|
||||
// GetFaint returns the style's faint value. If no value is set false is
|
||||
// returned.
|
||||
func (s Style) GetFaint() bool {
|
||||
return s.getAsBool(faintKey, false)
|
||||
@ -72,7 +72,7 @@ func (s Style) GetHeight() int {
|
||||
}
|
||||
|
||||
// GetAlign returns the style's implicit horizontal alignment setting.
|
||||
// If no alignment is set Position.AlignLeft is returned.
|
||||
// If no alignment is set Position.Left is returned.
|
||||
func (s Style) GetAlign() Position {
|
||||
v := s.getAsPosition(alignHorizontalKey)
|
||||
if v == Position(0) {
|
||||
@ -82,7 +82,7 @@ func (s Style) GetAlign() Position {
|
||||
}
|
||||
|
||||
// GetAlignHorizontal returns the style's implicit horizontal alignment setting.
|
||||
// If no alignment is set Position.AlignLeft is returned.
|
||||
// If no alignment is set Position.Left is returned.
|
||||
func (s Style) GetAlignHorizontal() Position {
|
||||
v := s.getAsPosition(alignHorizontalKey)
|
||||
if v == Position(0) {
|
||||
@ -92,7 +92,7 @@ func (s Style) GetAlignHorizontal() Position {
|
||||
}
|
||||
|
||||
// GetAlignVertical returns the style's implicit vertical alignment setting.
|
||||
// If no alignment is set Position.AlignTop is returned.
|
||||
// If no alignment is set Position.Top is returned.
|
||||
func (s Style) GetAlignVertical() Position {
|
||||
v := s.getAsPosition(alignVerticalKey)
|
||||
if v == Position(0) {
|
||||
|
2
runes.go
2
runes.go
@ -4,7 +4,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// StyleRunes applys a given style to runes at the given indicesin the string.
|
||||
// StyleRunes applys a given style to runes at the given indices in the string.
|
||||
// Note that you must provide styling options for both matched and unmatched
|
||||
// runes. Indices out of bounds will be ignored.
|
||||
func StyleRunes(str string, indices []int, matched, unmatched Style) string {
|
||||
|
4
set.go
4
set.go
@ -39,7 +39,7 @@ func (s Style) Italic(v bool) Style {
|
||||
|
||||
// Underline sets an underline rule. By default, underlines will not be drawn on
|
||||
// whitespace like margins and padding. To change this behavior set
|
||||
// renderUnderlinesOnSpaces.
|
||||
// UnderlineSpaces.
|
||||
func (s Style) Underline(v bool) Style {
|
||||
s.set(underlineKey, v)
|
||||
return s
|
||||
@ -47,7 +47,7 @@ func (s Style) Underline(v bool) Style {
|
||||
|
||||
// Strikethrough sets a strikethrough rule. By default, strikes will not be
|
||||
// drawn on whitespace like margins and padding. To change this behavior set
|
||||
// renderStrikethroughOnSpaces.
|
||||
// StrikethroughSpaces.
|
||||
func (s Style) Strikethrough(v bool) Style {
|
||||
s.set(strikethroughKey, v)
|
||||
return s
|
||||
|
Loading…
Reference in New Issue
Block a user