Skip to content

Commit

Permalink
Fix and generally improve various doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Feb 14, 2022
1 parent 0a77f63 commit 514fa05
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion borders.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func RoundedBorder() Border {
return roundedBorder
}

// Thick border returns a border that's thicker than the one returned by
// ThickBorder returns a border that's thicker than the one returned by
// NormalBorder.
func ThickBorder() Border {
return thickBorder
Expand Down
2 changes: 1 addition & 1 deletion get.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func (s Style) GetBorderLeftSize() int {
return s.getBorderStyle().GetLeftSize()
}

// GetBorderLeftWidth returns the width of the bottom border. If borders
// GetBorderBottomSize returns the width of the bottom border. If borders
// contain runes of varying widths, the widest rune is returned. If no border
// exists on the left edge, 0 is returned.
func (s Style) GetBorderBottomSize() int {
Expand Down
23 changes: 14 additions & 9 deletions set.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,31 +349,34 @@ func (s Style) BorderForeground(c ...TerminalColor) Style {
return s
}

// BorderTopForegroundColor set the top color of the border.
// BorderTopForeground set the foreground color for the top of the border.
func (s Style) BorderTopForeground(c TerminalColor) Style {
s.set(borderTopForegroundKey, c)
return s
}

// BorderRightForegroundColor set the top color of the border.
// BorderRightForeground sets the foreground color for the right side of the
// border.
func (s Style) BorderRightForeground(c TerminalColor) Style {
s.set(borderRightForegroundKey, c)
return s
}

// BorderBottomForegroundColor set the top color of the border.
// BorderBottomForeground sets the foreground color for the bottom of the
// border.
func (s Style) BorderBottomForeground(c TerminalColor) Style {
s.set(borderBottomForegroundKey, c)
return s
}

// BorderLeftForegroundColor set the top color of the border.
// BorderLeftForeground sets the foreground color for the left side of the
// border.
func (s Style) BorderLeftForeground(c TerminalColor) Style {
s.set(borderLeftForegroundKey, c)
return s
}

// BorderBackgroundColor is a shorthand function for setting all of the
// BorderBackground is a shorthand function for setting all of the
// background colors of the borders at once. The arguments work as follows:
//
// With one argument, the argument is applied to all sides.
Expand Down Expand Up @@ -406,25 +409,27 @@ func (s Style) BorderBackground(c ...TerminalColor) Style {
return s
}

// BorderTopBackgroundColor set the top color of the border.
// BorderTopBackground sets the background color of the top of the border.
func (s Style) BorderTopBackground(c TerminalColor) Style {
s.set(borderTopBackgroundKey, c)
return s
}

// BorderRightBackgroundColor set the top color of the border.
// BorderRightBackground sets the background color of right side the border.
func (s Style) BorderRightBackground(c TerminalColor) Style {
s.set(borderRightBackgroundKey, c)
return s
}

// BorderBottomBackgroundColor set the top color of the border.
// BorderBottomBackground sets the background color of the bottom of the
// border.
func (s Style) BorderBottomBackground(c TerminalColor) Style {
s.set(borderBottomBackgroundKey, c)
return s
}

// BorderLeftBackgroundColor set the top color of the border.
// BorderLeftBackground set the background color of the left side of the
// border.
func (s Style) BorderLeftBackground(c TerminalColor) Style {
s.set(borderLeftBackgroundKey, c)
return s
Expand Down
2 changes: 1 addition & 1 deletion style.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (s Style) SetString(str string) Style {
return s
}

// Value returns the raw, unformatted, underlying value for this style.
// Value returns the raw, unformatted, underlying string value for this style.
func (s Style) Value() string {
return s.value
}
Expand Down
6 changes: 3 additions & 3 deletions unset.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (s Style) UnsetItalic() Style {
return s
}

// UnsetItalic removes the underline style rule, if set.
// UnsetUnderline removes the underline style rule, if set.
func (s Style) UnsetUnderline() Style {
delete(s.rules, underlineKey)
return s
Expand Down Expand Up @@ -229,7 +229,7 @@ func (s Style) UnsetBorderBackground() Style {
return s
}

// UnsetBorderTopBackground removes the top border background color rule,
// UnsetBorderTopBackgroundColor removes the top border background color rule,
// if set.
func (s Style) UnsetBorderTopBackgroundColor() Style {
delete(s.rules, borderTopBackgroundKey)
Expand Down Expand Up @@ -280,7 +280,7 @@ func (s Style) UnsetUnderlineSpaces() Style {
return s
}

// UnsetUnderlineSpaces removes the value set by UnsetStrikethroughSpaces.
// UnsetStrikethroughSpaces removes the value set by StrikethroughSpaces.
func (s Style) UnsetStrikethroughSpaces() Style {
delete(s.rules, strikethroughSpacesKey)
return s
Expand Down
4 changes: 2 additions & 2 deletions whitespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (w whitespace) render(width int) string {
return w.style.Styled(b.String())
}

// WhiteSpaceOption sets a styling rule for rendering whitespace.
// WhitespaceOption sets a styling rule for rendering whitespace.
type WhitespaceOption func(*whitespace)

// WithWhitespaceForeground sets the color of the characters in the whitespace.
Expand All @@ -53,7 +53,7 @@ func WithWhitespaceForeground(c TerminalColor) WhitespaceOption {
}
}

// WithWhiteSpaceBackground sets the background color of the whitespace.
// WithWhitespaceBackground sets the background color of the whitespace.
func WithWhitespaceBackground(c TerminalColor) WhitespaceOption {
return func(w *whitespace) {
w.style = w.style.Background(c.color())
Expand Down

0 comments on commit 514fa05

Please sign in to comment.