(text string, width, subsequentIndent int)
| 92 | } |
| 93 | |
| 94 | func printWrappedText(text string, width, subsequentIndent int) { |
| 95 | tokens := strings.Split(text, " ") |
| 96 | offset := 0 |
| 97 | for i, token := range tokens { |
| 98 | if i > 0 && offset+len(token) > width { |
| 99 | fmt.Printf("\n%s", strings.Repeat(" ", subsequentIndent)) |
| 100 | offset = 0 |
| 101 | } |
| 102 | fmt.Printf("%s", token) |
| 103 | offset += len(token) |
| 104 | if offset < width && i != len(tokens)-1 { |
| 105 | fmt.Print(" ") |
| 106 | offset++ |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | func formatTask(width, depth int, task Task, options *ViewOptions) { |
| 112 | indent := depth*4 + 4 |
no outgoing calls
no test coverage detected