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"
|
"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 {
|
func (s Style) GetBold() bool {
|
||||||
return s.getAsBool(boldKey, false)
|
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.
|
// returned.
|
||||||
func (s Style) GetItalic() bool {
|
func (s Style) GetItalic() bool {
|
||||||
return s.getAsBool(italicKey, false)
|
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.
|
// returned.
|
||||||
func (s Style) GetUnderline() bool {
|
func (s Style) GetUnderline() bool {
|
||||||
return s.getAsBool(underlineKey, false)
|
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.
|
// is returned.
|
||||||
func (s Style) GetStrikethrough() bool {
|
func (s Style) GetStrikethrough() bool {
|
||||||
return s.getAsBool(strikethroughKey, false)
|
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.
|
// returned.
|
||||||
func (s Style) GetReverse() bool {
|
func (s Style) GetReverse() bool {
|
||||||
return s.getAsBool(reverseKey, false)
|
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.
|
// returned.
|
||||||
func (s Style) GetBlink() bool {
|
func (s Style) GetBlink() bool {
|
||||||
return s.getAsBool(blinkKey, false)
|
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.
|
// returned.
|
||||||
func (s Style) GetFaint() bool {
|
func (s Style) GetFaint() bool {
|
||||||
return s.getAsBool(faintKey, false)
|
return s.getAsBool(faintKey, false)
|
||||||
@ -72,7 +72,7 @@ func (s Style) GetHeight() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetAlign returns the style's implicit horizontal alignment setting.
|
// 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 {
|
func (s Style) GetAlign() Position {
|
||||||
v := s.getAsPosition(alignHorizontalKey)
|
v := s.getAsPosition(alignHorizontalKey)
|
||||||
if v == Position(0) {
|
if v == Position(0) {
|
||||||
@ -82,7 +82,7 @@ func (s Style) GetAlign() Position {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetAlignHorizontal returns the style's implicit horizontal alignment setting.
|
// 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 {
|
func (s Style) GetAlignHorizontal() Position {
|
||||||
v := s.getAsPosition(alignHorizontalKey)
|
v := s.getAsPosition(alignHorizontalKey)
|
||||||
if v == Position(0) {
|
if v == Position(0) {
|
||||||
@ -92,7 +92,7 @@ func (s Style) GetAlignHorizontal() Position {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetAlignVertical returns the style's implicit vertical alignment setting.
|
// 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 {
|
func (s Style) GetAlignVertical() Position {
|
||||||
v := s.getAsPosition(alignVerticalKey)
|
v := s.getAsPosition(alignVerticalKey)
|
||||||
if v == Position(0) {
|
if v == Position(0) {
|
||||||
|
2
runes.go
2
runes.go
@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"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
|
// Note that you must provide styling options for both matched and unmatched
|
||||||
// runes. Indices out of bounds will be ignored.
|
// runes. Indices out of bounds will be ignored.
|
||||||
func StyleRunes(str string, indices []int, matched, unmatched Style) string {
|
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
|
// Underline sets an underline rule. By default, underlines will not be drawn on
|
||||||
// whitespace like margins and padding. To change this behavior set
|
// whitespace like margins and padding. To change this behavior set
|
||||||
// renderUnderlinesOnSpaces.
|
// UnderlineSpaces.
|
||||||
func (s Style) Underline(v bool) Style {
|
func (s Style) Underline(v bool) Style {
|
||||||
s.set(underlineKey, v)
|
s.set(underlineKey, v)
|
||||||
return s
|
return s
|
||||||
@ -47,7 +47,7 @@ func (s Style) Underline(v bool) Style {
|
|||||||
|
|
||||||
// Strikethrough sets a strikethrough rule. By default, strikes will not be
|
// Strikethrough sets a strikethrough rule. By default, strikes will not be
|
||||||
// drawn on whitespace like margins and padding. To change this behavior set
|
// drawn on whitespace like margins and padding. To change this behavior set
|
||||||
// renderStrikethroughOnSpaces.
|
// StrikethroughSpaces.
|
||||||
func (s Style) Strikethrough(v bool) Style {
|
func (s Style) Strikethrough(v bool) Style {
|
||||||
s.set(strikethroughKey, v)
|
s.set(strikethroughKey, v)
|
||||||
return s
|
return s
|
||||||
|
2
style.go
2
style.go
@ -432,7 +432,7 @@ func padLeft(str string, n int, style *termenv.Style) string {
|
|||||||
return b.String()
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply right right padding.
|
// Apply right padding.
|
||||||
func padRight(str string, n int, style *termenv.Style) string {
|
func padRight(str string, n int, style *termenv.Style) string {
|
||||||
if n == 0 || str == "" {
|
if n == 0 || str == "" {
|
||||||
return str
|
return str
|
||||||
|
Loading…
Reference in New Issue
Block a user