summaryrefslogtreecommitdiff
path: root/internal/askcli/command_complete_uuids.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-05 10:26:16 +0300
committerPaul Buetow <paul@buetow.org>2026-06-05 10:26:16 +0300
commit1433f7a13ede0c819ec4f8fd4027ad3df8daa94f (patch)
treed3e98bc150711350585dd8203c5b50cc93243e52 /internal/askcli/command_complete_uuids.go
parent0a52adf5752835da01e8a29df15e415398165c48 (diff)
Add 'ask edit' subcommand and collapse multi-line task descriptionsv0.40.0
- ask edit opens $EDITOR and creates a task from the (multi-line) content, reusing the shared internal/editor package - collapse newlines in list output and fish completion so multi-line descriptions render on one line and don't break completion Bump version to 0.40.0 Amp-Thread-ID: https://ampcode.com/threads/T-019e96a1-9c8e-73d6-95b4-b55cb12cc762 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/askcli/command_complete_uuids.go')
-rw-r--r--internal/askcli/command_complete_uuids.go6
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