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

[PATCH] Completion: Fix `_files -F '(pat ...)'`



_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