zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Zsh workers <zsh-workers@zsh.org>
Subject: [PATCH] Completion: Fix `_files -F '(pat ...)'`
Date: Fri, 7 Dec 2018 18:55:26 -0600	[thread overview]
Message-ID: <6027705B-D6FE-47AB-B831-4C7345B1713E@dana.is> (raw)

_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


             reply	other threads:[~2018-12-08  0:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-08  0:55 dana [this message]
2018-12-08  0:57 ` dana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6027705B-D6FE-47AB-B831-4C7345B1713E@dana.is \
    --to=dana@dana.is \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).