Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] _alternative: Fix (...) action syntax



A long time ago Oliver found that _alternative didn't handle the ((...\:...))
action syntax properly, and that was fixed in workers/18347. But it also
didn't handle (...) properly, and i think the same kind of fix is probably
warranted (just copy/paste from _arguments basically). So here's that

PS: Sorry for bug/patch spam, lots of unstructured holiday free time here

dana


diff --git a/Completion/Base/Utility/_alternative b/Completion/Base/Utility/_alternative
index bfb34a604..3c61d1125 100644
--- a/Completion/Base/Utility/_alternative
+++ b/Completion/Base/Utility/_alternative
@@ -43,8 +43,10 @@ while _tags; do
 
         # Anything inside `(...)' is added directly.
 
+        eval ws\=\( "${action[2,-2]}" \)
+
         _all_labels "${def%%:*}" expl "$descr" \
-            compadd "$subopts[@]" - ${=action[2,-2]}
+            compadd "$subopts[@]" -a - ws
       elif [[ "$action" = \{*\} ]]; then
 
         # A string in braces is evaluated.



Messages sorted by: Reverse Date, Date, Thread, Author