zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Completion: Fix `_files -F '(pat ...)'`
@ 2018-12-08  0:55 dana
  2018-12-08  0:57 ` dana
  0 siblings, 1 reply; 2+ messages in thread
From: dana @ 2018-12-08  0:55 UTC (permalink / raw)
  To: Zsh workers

_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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-08  0:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-08  0:55 [PATCH] Completion: Fix `_files -F '(pat ...)'` dana
2018-12-08  0:57 ` dana

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).