zsh-workers
 help / 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

* Re: [PATCH] Completion: Fix `_files -F '(pat ...)'`
  2018-12-08  0:55 [PATCH] Completion: Fix `_files -F '(pat ...)'` dana
@ 2018-12-08  0:57 ` dana
  0 siblings, 0 replies; 2+ messages in thread
From: dana @ 2018-12-08  0:57 UTC (permalink / raw)
  To: Zsh workers

On 7 Dec 2018, at 18:55, dana <dana@dana.is> wrote:
For example, `-F '(a\ *b)'` yields an array with the patterns `a`,
`\ `, and `*b`.

Er, `a\` and `*b`, rather, obv

dana


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

end of thread, back to index

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

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/ public-inbox