From 1c1240fd653db91c5a262fa19dca161c31964b02 Mon Sep 17 00:00:00 2001 From: nervo Date: Tue, 8 Nov 2022 10:55:11 +0100 Subject: [PATCH] docs: fix various typos (#156) --- README.md | 2 +- borders.go | 2 +- color.go | 6 +++--- get.go | 2 +- position.go | 4 ++-- runes.go | 2 +- set.go | 14 +++++++------- style.go | 2 +- unset.go | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index c4c282ef..468ecb61 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,7 @@ var wildStyle = style.Copy().Blink(true) ``` `Copy()` performs a copy on the underlying data structure ensuring that you get -a true, dereferenced copy of a style. Without copying it's possible to mutate +a true, dereferenced copy of a style. Without copying, it's possible to mutate styles. diff --git a/borders.go b/borders.go index 23372808..b33b8e58 100644 --- a/borders.go +++ b/borders.go @@ -247,7 +247,7 @@ func (s Style) applyBorder(str string) string { border.Right = " " } - // If corners should be render but are set with the empty string, fill them + // If corners should be rendered but are set with the empty string, fill them // with a single space. if hasTop && hasLeft && border.TopLeft == "" { border.TopLeft = " " diff --git a/color.go b/color.go index d70dfaf3..e154539c 100644 --- a/color.go +++ b/color.go @@ -178,7 +178,7 @@ func (ac AdaptiveColor) RGBA() (r, g, b, a uint32) { } // CompleteColor specifies exact values for truecolor, ANSI256, and ANSI color -// profiles. Automatic color degredation will not be performed. +// profiles. Automatic color degradation will not be performed. type CompleteColor struct { TrueColor string ANSI256 string @@ -210,9 +210,9 @@ func (c CompleteColor) RGBA() (r, g, b, a uint32) { return termenv.ConvertToRGB(c.color()).RGBA() } -// CompleteColor specifies exact values for truecolor, ANSI256, and ANSI color +// CompleteAdaptiveColor specifies exact values for truecolor, ANSI256, and ANSI color // profiles, with separate options for light and dark backgrounds. Automatic -// color degredation will not be performed. +// color degradation will not be performed. type CompleteAdaptiveColor struct { Light CompleteColor Dark CompleteColor diff --git a/get.go b/get.go index 2613750f..856d1f61 100644 --- a/get.go +++ b/get.go @@ -200,7 +200,7 @@ func (s Style) GetVerticalMargins() int { // GetBorder returns the style's border style (type Border) and value for the // top, right, bottom, and left in that order. If no value is set for the // border style, Border{} is returned. For all other unset values false is -// returend. +// returned. func (s Style) GetBorder() (b Border, top, right, bottom, left bool) { return s.getBorderStyle(), s.getAsBool(borderTopKey, false), diff --git a/position.go b/position.go index 2ecb8979..f419452b 100644 --- a/position.go +++ b/position.go @@ -39,7 +39,7 @@ func Place(width, height int, hPos, vPos Position, str string, opts ...Whitespac // PlaceHorizontal places a string or text block horizontally in an unstyled // block of a given width. If the given width is shorter than the max width of -// the string (measured by it's longest line) this will be a noöp. +// the string (measured by its longest line) this will be a noop. func PlaceHorizontal(width int, pos Position, str string, opts ...WhitespaceOption) string { lines, contentWidth := getLines(str) gap := width - contentWidth @@ -89,7 +89,7 @@ func PlaceHorizontal(width int, pos Position, str string, opts ...WhitespaceOpti // PlaceVertical places a string or text block vertically in an unstyled block // of a given height. If the given height is shorter than the height of the -// string (measured by it's newlines) then this will be a noöp. +// string (measured by its newlines) then this will be a noop. func PlaceVertical(height int, pos Position, str string, opts ...WhitespaceOption) string { contentHeight := strings.Count(str, "\n") + 1 gap := height - contentHeight diff --git a/runes.go b/runes.go index 2c5265a3..7a49e326 100644 --- a/runes.go +++ b/runes.go @@ -4,7 +4,7 @@ import ( "strings" ) -// StyleRunes applys a given style to runes at the given indices in the string. +// StyleRunes apply 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 { diff --git a/set.go b/set.go index 21a9ce4f..38a0ed17 100644 --- a/set.go +++ b/set.go @@ -1,7 +1,7 @@ package lipgloss // This could (should) probably just be moved into NewStyle(). We've broken it -// out so we can call it in a lazy way. +// out, so we can call it in a lazy way. func (s *Style) init() { if s.rules == nil { s.rules = make(rules) @@ -16,7 +16,7 @@ func (s *Style) set(key propKey, value interface{}) { case int: // We don't allow negative integers on any of our values, so just keep // them at zero or above. We could use uints instead, but the - // conversions are a little tedious so we're sticking with ints for + // conversions are a little tedious, so we're sticking with ints for // sake of usability. s.rules[key] = max(0, v) default: @@ -120,13 +120,13 @@ func (s Style) Align(p ...Position) Style { return s } -// HorizontalAlign sets a horizontal text alignment rule. +// AlignHorizontal sets a horizontal text alignment rule. func (s Style) AlignHorizontal(p Position) Style { s.set(alignHorizontalKey, p) return s } -// VerticalAlign sets a text alignment rule. +// AlignVertical sets a text alignment rule. func (s Style) AlignVertical(p Position) Style { s.set(alignVerticalKey, p) return s @@ -251,7 +251,7 @@ func (s Style) MarginBackground(c TerminalColor) Style { return s } -// Border is shorthand for setting a the border style and which sides should +// Border is shorthand for setting the border style and which sides should // have a border at once. The variadic argument sides works as follows: // // With one value, the value is applied to all sides. @@ -505,7 +505,7 @@ func (s Style) MaxHeight(n int) Style { } // UnderlineSpaces determines whether to underline spaces between words. By -// default this is true. Spaces can also be underlined without underlining the +// default, this is true. Spaces can also be underlined without underlining the // text itself. func (s Style) UnderlineSpaces(v bool) Style { s.set(underlineSpacesKey, v) @@ -513,7 +513,7 @@ func (s Style) UnderlineSpaces(v bool) Style { } // StrikethroughSpaces determines whether to apply strikethroughs to spaces -// between words. By default this is true. Spaces can also be struck without +// between words. By default, this is true. Spaces can also be struck without // underlining the text itself. func (s Style) StrikethroughSpaces(v bool) Style { s.set(strikethroughSpacesKey, v) diff --git a/style.go b/style.go index 4c149326..a9fbb044 100644 --- a/style.go +++ b/style.go @@ -77,7 +77,7 @@ type rules map[propKey]interface{} // NewStyle returns a new, empty Style. While it's syntactic sugar for the // Style{} primitive, it's recommended to use this function for creating styles -// incase the underlying implementation changes. +// in case the underlying implementation changes. func NewStyle() Style { return Style{} } diff --git a/unset.go b/unset.go index 25f3ac92..a8367898 100644 --- a/unset.go +++ b/unset.go @@ -79,7 +79,7 @@ func (s Style) UnsetAlignHorizontal() Style { return s } -// UnsetAlignHorizontal removes the vertical text alignment style rule, if set. +// UnsetAlignVertical removes the vertical text alignment style rule, if set. func (s Style) UnsetAlignVertical() Style { delete(s.rules, alignVerticalKey) return s