Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Completion: Fix `_files -F '(pat ...)'`
- X-seq: zsh-workers 43871
- From: dana <dana@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: [PATCH] Completion: Fix `_files -F '(pat ...)'`
- Date: Fri, 7 Dec 2018 18:55:26 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=97WpPHTkQ9TnSi8AI70PG56qKyhypejE5tygjeVgvuw=; b=W9Wtfsx71XcG3Z8Jbo6dk/Nw/x8DZ7T3CAR12sByHMuBGauTyHd4Cax0Ow4WtgxdcB E1wnbUuzt/UdXIZ+lsp2mmnwUaNUYLtXZIbvQyOaMHYz8Faa1+kGHUbgDmp1ZMP5KEVa QmuiduVqGtqYxmurPJHdvoyt20jQ31p6o72Hmdu5isEIvifTULlfPtv4OiEcRhbZwnfS jaIOYEgga+3ZGdtT7MB1HZ2C6cQKEIXSuZqTiA2fMwuqzaJ6xbT5lY/ygqX8fFp2vxhY Z+Un36g5WOGIwWFZOnUwoc2aFyOqhNNildkDzruta0YNk+ZSf99KrF9uIvnn5uKU5N4a eBWQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
_files doesn't support the `-F '(pat ...)'` syntax that _path_files itself
does. Just carrying the same check over from _path_files fixes it.
I noticed that this method can't support patterns containing white space,
though. For example, `-F '(a\ *b)'` yields an array with the patterns `a`,
`\ `, and `*b`. Would it be better to use something like
${(Q)${(Z<Cn>)ignvars[2,-2]}} here, or do we just say that if you need
white space you have to use an intermediate array?
dana
diff --git a/Completion/Unix/Type/_files b/Completion/Unix/Type/_files
index e3212c952..467ed747c 100644
--- a/Completion/Unix/Type/_files
+++ b/Completion/Unix/Type/_files
@@ -46,6 +46,8 @@ if (( tmp )); then
ignvars=($=opts[tmp+1])
if [[ $ignvars = _comp_ignore ]]; then
ign=( $_comp_ignore )
+ elif [[ $ignvars = \(* ]]; then
+ ign=( ${=ignvars[2,-2]} )
else
ign=()
for ignvar in $ignvars; do
Messages sorted by:
Reverse Date,
Date,
Thread,
Author