diff options
Diffstat (limited to 'internal/askcli/command_complete_uuids.go')
| -rw-r--r-- | internal/askcli/command_complete_uuids.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/askcli/command_complete_uuids.go b/internal/askcli/command_complete_uuids.go index bc160b6..5c26649 100644 --- a/internal/askcli/command_complete_uuids.go +++ b/internal/askcli/command_complete_uuids.go @@ -85,9 +85,11 @@ func taskCompletionAliasItems(tasks []TaskExport, aliases map[string]string) []s return items } -// truncateDescription shortens s to at most maxLen characters, appending "…" -// when the string is cut, so the completion hint fits on one line. +// truncateDescription collapses any embedded newlines to keep the completion +// item on a single line, then shortens s to at most maxLen characters, +// appending "…" when the string is cut, so the completion hint fits on one line. func truncateDescription(s string, maxLen int) string { + s = oneLineDescription(s) runes := []rune(s) if len(runes) <= maxLen { return s |
