Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Improve quote handling in _ant completion
- X-seq: zsh-workers 52335
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: German Riano <griano@xxxxxxxxx>
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: Improve quote handling in _ant completion
- Date: Wed, 29 Nov 2023 11:18:08 -0800
- Archived-at: <https://zsh.org/workers/52335>
- In-reply-to: <207461559.9336309.1701221332233@mail.yahoo.com>
- List-id: <zsh-workers.zsh.org>
- References: <207461559.9336309.1701221332233.ref@mail.yahoo.com> <207461559.9336309.1701221332233@mail.yahoo.com>
On Tue, Nov 28, 2023 at 5:30 PM German Riano <griano@xxxxxxxxx> wrote:
>
> In the current completion, if a task description contains a quote (') the completions do not render properly
>
> In this patch I propose to build the tmp array via
> tmp=( ${(f@)"$(command)"} )
> and print one line at a time.
Does this smaller change work instead? (I suspect the "eval" could be
eliminated by tweaking this further.)
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant
index 36c7c0e89..aea3f51ec 100644
--- a/Completion/Unix/Command/_ant
+++ b/Completion/Unix/Command/_ant
@@ -122,7 +122,7 @@ case $state in
read default_target junk
fi
# Output target again indicating its the default one.
- print -n "'${default_target}:(Default target) ' "
+ print -rn -- "${(qq):-${default_target}:(Default
target) } "
;;
(Searching:*|Main:targets:|Subtargets:|BUILD:SUCCESSFUL|Total:time:*)
;;
> Also I am proposing to shield 'find_targets' with '(( $#functions[find_targets] )) ||' so that users can easily override the function.
No particular objection to this, though I wonder if it should be tied
to the "targets" style and _call_program (Oliver?)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author