(width, depth int, task Task, options *ViewOptions)
| 109 | } |
| 110 | |
| 111 | func formatTask(width, depth int, task Task, options *ViewOptions) { |
| 112 | indent := depth*4 + 4 |
| 113 | width -= indent |
| 114 | state := taskState(task) |
| 115 | fmt.Printf("%s%s%c%2d.%s%s", strings.Repeat(" ", depth), NUMBER_COLOR, state, |
| 116 | task.ID()+1, RESET, colourPriorityMap[task.Priority()]) |
| 117 | text := task.Text() |
| 118 | trimmed := false |
| 119 | if options.Summarise { |
| 120 | if len(text) > width { |
| 121 | text = strings.TrimSpace(text[:width-1]) |
| 122 | trimmed = true |
| 123 | } |
| 124 | } |
| 125 | printWrappedText(text, width, indent) |
| 126 | if trimmed { |
| 127 | fmt.Printf("%s+%s\n", TITLE_COLOUR, RESET) |
| 128 | } else { |
| 129 | fmt.Printf("%s\n", RESET) |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | func consoleDisplayTask(width, depth int, task Task, options *ViewOptions) { |
| 134 | if depth >= 0 && (!options.ShowAll && !task.CompletionTime().IsZero()) { |
no test coverage detected