(line string, maxLen int)
| 232 | } |
| 233 | |
| 234 | func truncateDisplayLineWithEllipsis(line string, maxLen int) string { |
| 235 | runes := []rune(line) |
| 236 | if len(runes) <= maxLen { |
| 237 | return line |
| 238 | } |
| 239 | if maxLen <= 0 { |
| 240 | return "" |
| 241 | } |
| 242 | if maxLen <= 3 { |
| 243 | return string(runes[:maxLen]) |
| 244 | } |
| 245 | return string(runes[:maxLen-3]) + "..." |
| 246 | } |
| 247 | |
| 248 | func countDisplayLines(text string) int { |
| 249 | count := strings.Count(text, "\n") + 1 |
no outgoing calls
no test coverage detected