diff --git a/container/grid/grid.go b/container/grid/grid.go index e15fe20..8118a12 100644 --- a/container/grid/grid.go +++ b/container/grid/grid.go @@ -53,11 +53,13 @@ func (b *Builder) Build() ([]container.Option, error) { // validate recursively validates the elements that were added to the builder. // Validates the following per each level of Rows or Columns.: -// The subElements are either exactly one Widget or any number of Rows and -// Columns. -// Each individual width or height is in the range 0 < v < 100. -// The sum of all widths is <= 100. -// The sum of all heights is <= 100. +// +// The subElements are either exactly one Widget or any number of Rows and +// Columns. +// Each individual width or height is in the range 0 < v < 100. +// The sum of all widths is <= 100. +// The sum of all heights is <= 100. +// // Argument fixedSizeParent indicates if any of the parent elements uses fixed // size splitType. func validate(elems []Element, fixedSizeParent bool) error { @@ -182,17 +184,26 @@ func build(elems []Element, parentHeightPerc, parentWidthPerc int) []container.O // E.g. multiple rows would specify that they want the outer split percentage // of 25% each, but we are representing them in a tree of containers so the // inner splits vary: -// ╭─────────╮ +// +// ╭─────────╮ +// // 25% │ 25% │ -// │╭───────╮│ --- +// +// │╭───────╮│ --- +// // 25% ││ 33% ││ -// ││╭─────╮││ +// +// ││╭─────╮││ +// // 25% │││ 50% │││ -// ││├─────┤││ 75% +// +// ││├─────┤││ 75% +// // 25% │││ 50% │││ -// ││╰─────╯││ -// │╰───────╯│ -// ╰─────────╯ --- +// +// ││╰─────╯││ +// │╰───────╯│ +// ╰─────────╯ --- // // Argument outerPerc is the user specified percentage for the split, i.e. the // 25% in the example above. diff --git a/private/canvas/braille/braille.go b/private/canvas/braille/braille.go index 7cd902f..85f5577 100644 --- a/private/canvas/braille/braille.go +++ b/private/canvas/braille/braille.go @@ -27,13 +27,13 @@ right and down. Each cell: - X→ 0 1 Y - ┌───┐ ↓ - │● ●│ 0 - │● ●│ 1 - │● ●│ 2 - │● ●│ 3 - └───┘ + X→ 0 1 Y + ┌───┐ ↓ + │● ●│ 0 + │● ●│ 1 + │● ●│ 2 + │● ●│ 3 + └───┘ When using the braille canvas, the coordinates address the sub-cell points rather then cells themselves. However all points in the cell still share the diff --git a/private/draw/vertical_text.go b/private/draw/vertical_text.go index 44aadc9..7cac908 100644 --- a/private/draw/vertical_text.go +++ b/private/draw/vertical_text.go @@ -75,11 +75,12 @@ func VerticalTextOverrunMode(om OverrunMode) VerticalTextOption { // VerticalText prints the provided text on the canvas starting at the provided point. // The text is printed in a vertical orientation, i.e: -// H -// e -// l -// l -// o +// +// H +// e +// l +// l +// o func VerticalText(c *canvas.Canvas, text string, start image.Point, opts ...VerticalTextOption) error { ar := c.Area() if !start.In(ar) { diff --git a/private/numbers/trig/trig.go b/private/numbers/trig/trig.go index 16d179d..a3945bb 100644 --- a/private/numbers/trig/trig.go +++ b/private/numbers/trig/trig.go @@ -128,9 +128,10 @@ func (ar *angleRange) contains(angle int) bool { // normalizeRange normalizes the start and end angles in degrees into ranges of // angles. Useful for cases where the 0/360 point falls within the range. // E.g: -// 0,25 => angleRange{0, 26} -// 0,360 => angleRange{0, 361} -// 359,20 => angleRange{359, 361}, angleRange{0, 21} +// +// 0,25 => angleRange{0, 26} +// 0,360 => angleRange{0, 361} +// 359,20 => angleRange{359, 361}, angleRange{0, 21} func normalizeRange(start, end int) ([]*angleRange, error) { if start < MinAngle || start > MaxAngle { return nil, fmt.Errorf("invalid start angle:%d, must be in range %d <= start <= %d", start, MinAngle, MaxAngle) @@ -159,8 +160,9 @@ func normalizeRange(start, end int) ([]*angleRange, error) { // RangeSize returns the size of the degree range. // E.g: -// 0,25 => 25 -// 359,1 => 2 +// +// 0,25 => 25 +// 359,1 => 2 func RangeSize(start, end int) (int, error) { ranges, err := normalizeRange(start, end) if err != nil { @@ -174,8 +176,9 @@ func RangeSize(start, end int) (int, error) { // RangeMid returns an angle that lies in the middle between start and end. // E.g: -// 0,10 => 5 -// 350,10 => 0 +// +// 0,10 => 5 +// 350,10 => 0 func RangeMid(start, end int) (int, error) { ranges, err := normalizeRange(start, end) if err != nil { diff --git a/private/segdisp/dotseg/dotseg.go b/private/segdisp/dotseg/dotseg.go index 2d603e2..869d177 100644 --- a/private/segdisp/dotseg/dotseg.go +++ b/private/segdisp/dotseg/dotseg.go @@ -21,19 +21,19 @@ display dot characters. The following outlines segments in the display and their names. - --------------- - | | - | | - | | - | o D1 | - | | - | | - | | - | o D2 | - | | - | | - | o D3 | - --------------- + --------------- + | | + | | + | | + | o D1 | + | | + | | + | | + | o D2 | + | | + | | + | o D3 | + --------------- */ package dotseg diff --git a/private/segdisp/segment/segment.go b/private/segdisp/segment/segment.go index 37e4f1f..098c17a 100644 --- a/private/segdisp/segment/segment.go +++ b/private/segdisp/segment/segment.go @@ -95,14 +95,15 @@ func SkipSlopesLTE(v int) Option { // This only has a visible effect when the horizontal segment has height of two // or the vertical segment has width of two. // Without this option segments with height / width of two look like this: -// - | -// --- || -// | +// - | +// --- || +// | // // With this option: -// --- | -// - || -// | +// +// --- | +// - || +// | func ReverseSlopes() Option { return option(func(opts *options) { opts.reverseSlopes = true diff --git a/private/segdisp/sixteen/sixteen.go b/private/segdisp/sixteen/sixteen.go index 2013f7f..eb71643 100644 --- a/private/segdisp/sixteen/sixteen.go +++ b/private/segdisp/sixteen/sixteen.go @@ -21,21 +21,21 @@ display ASCII characters. The following outlines segments in the display and their names. - A1 A2 - ------- ------- - | \ | / | - | \ | / | - F | H J K | B - | \ | / | - | \ | / | - -G1---- ----G2- - | / | \ | - | / | \ | - E | N M L | C - | / | \ | - | / | \ | - ------- ------- - D1 D2 + A1 A2 + ------- ------- + | \ | / | + | \ | / | + F | H J K | B + | \ | / | + | \ | / | + -G1---- ----G2- + | / | \ | + | / | \ | + E | N M L | C + | / | \ | + | / | \ | + ------- ------- + D1 D2 */ package sixteen diff --git a/termdashdemo/termdashdemo.go b/termdashdemo/termdashdemo.go index 2df4499..b9620e2 100644 --- a/termdashdemo/termdashdemo.go +++ b/termdashdemo/termdashdemo.go @@ -976,8 +976,10 @@ func newLayoutButtons(c *container.Container, w *widgets) (*layoutButtons, error // rotateFloats returns a new slice with inputs rotated by step. // I.e. for a step of one: -// inputs[0] -> inputs[len(inputs)-1] -// inputs[1] -> inputs[0] +// +// inputs[0] -> inputs[len(inputs)-1] +// inputs[1] -> inputs[0] +// // And so on. func rotateFloats(inputs []float64, step int) []float64 { return append(inputs[step:], inputs[:step]...) @@ -985,8 +987,10 @@ func rotateFloats(inputs []float64, step int) []float64 { // rotateRunes returns a new slice with inputs rotated by step. // I.e. for a step of one: -// inputs[0] -> inputs[len(inputs)-1] -// inputs[1] -> inputs[0] +// +// inputs[0] -> inputs[len(inputs)-1] +// inputs[1] -> inputs[0] +// // And so on. func rotateRunes(inputs []rune, step int) []rune { return append(inputs[step:], inputs[:step]...) diff --git a/widgets/linechart/internal/axes/scale.go b/widgets/linechart/internal/axes/scale.go index f193aae..10a194c 100644 --- a/widgets/linechart/internal/axes/scale.go +++ b/widgets/linechart/internal/axes/scale.go @@ -328,9 +328,10 @@ func (xs *XScale) CellLabel(x int) (*Value, error) { // the position. Positions grow up, coordinates grow down. // // Positions Y Coordinates -// 2 | 0 -// 1 | 1 -// 0 | 2 +// +// 2 | 0 +// 1 | 1 +// 0 | 2 func positionToY(pos int, height int) (int, error) { max := height - 1 if min := 0; pos < min || pos > max { diff --git a/widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go b/widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go index 5d04042..698b67f 100644 --- a/widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go +++ b/widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go @@ -62,8 +62,10 @@ func clock(ctx context.Context, sd *segmentdisplay.SegmentDisplay) { // rotate returns a new slice with inputs rotated by step. // I.e. for a step of one: -// inputs[0] -> inputs[len(inputs)-1] -// inputs[1] -> inputs[0] +// +// inputs[0] -> inputs[len(inputs)-1] +// inputs[1] -> inputs[0] +// // And so on. func rotate(inputs []rune, step int) []rune { return append(inputs[step:], inputs[:step]...) diff --git a/widgets/text/text.go b/widgets/text/text.go index 0cca121..b60d3c4 100644 --- a/widgets/text/text.go +++ b/widgets/text/text.go @@ -105,7 +105,9 @@ func (t *Text) contentCells() int { // Write writes text for the widget to display. Multiple calls append // additional text. The text contain cannot control characters // (unicode.IsControl) or space character (unicode.IsSpace) other than: -// ' ', '\n' +// +// ' ', '\n' +// // Any newline ('\n') characters are interpreted as newlines when displaying // the text. func (t *Text) Write(text string, wOpts ...WriteOption) error { diff --git a/widgets/textinput/textinputdemo/textinputdemo.go b/widgets/textinput/textinputdemo/textinputdemo.go index d4d468c..6784945 100644 --- a/widgets/textinput/textinputdemo/textinputdemo.go +++ b/widgets/textinput/textinputdemo/textinputdemo.go @@ -34,8 +34,10 @@ import ( // rotate returns a new slice with inputs rotated by step. // I.e. for a step of one: -// inputs[0] -> inputs[len(inputs)-1] -// inputs[1] -> inputs[0] +// +// inputs[0] -> inputs[len(inputs)-1] +// inputs[1] -> inputs[0] +// // And so on. func rotate(inputs []rune, step int) []rune { return append(inputs[step:], inputs[:step]...)