addVertPadding adds vertical padding lines using the given inner width. innerWidth represents the visible width between the vertical borders.
(innerWidth int)
| 25 | // |
| 26 | // innerWidth represents the visible width between the vertical borders. |
| 27 | func (b *Box) addVertPadding(innerWidth int) ([]string, error) { |
| 28 | if innerWidth < 0 { |
| 29 | innerWidth = 0 |
| 30 | } |
| 31 | padding := strings.Repeat(" ", innerWidth) |
| 32 | vertical, err := applyColor(b.vertical, b.color) |
| 33 | if err != nil { |
| 34 | return nil, err |
| 35 | } |
| 36 | |
| 37 | texts := make([]string, b.py) |
| 38 | for i := range texts { |
| 39 | texts[i] = vertical + padding + vertical |
| 40 | } |
| 41 | |
| 42 | return texts, nil |
| 43 | } |
| 44 | |
| 45 | // longestLine expands tabs in lines and determines longest visible |
| 46 | // return longest length and array of expanded lines |