From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: zsh-workers@zsh.org
Subject: [PATCH] removing all '-g' from glob in _files
Date: Tue, 5 Feb 2013 17:08:54 +0800 [thread overview]
Message-ID: <20130205090854.GA16389@localhost.localdomain> (raw)
Looks like we should remove all '-g' options from "glob" in _files.
With the old _files, we have this result:
% ls
a.c a.h a.sh
% compdef '_files -g "*.h" -g "*.c" -g "*.sh"' foo
% foo <tab> # only completes "a.h"
With the new _files, the <tab> will completes all three files here.
---
Completion/Unix/Type/_files | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Completion/Unix/Type/_files b/Completion/Unix/Type/_files
index 0a27158..0f6fcd6 100644
--- a/Completion/Unix/Type/_files
+++ b/Completion/Unix/Type/_files
@@ -8,7 +8,7 @@ zparseopts -a opts \
type="${(@j::M)${(@)tmp#-}#?}"
if (( $tmp[(I)-g*] )); then
- glob="${${${${(@M)tmp:#-g*}#-g}##[[:blank:]]#}%%[[:blank:]]#}"
+ glob="${${${(@)${(@M)tmp:#-g*}#-g}##[[:blank:]]#}%%[[:blank:]]#}"
[[ "$glob" = *[^\\][[:blank:]]* ]] &&
glob="{${glob//(#b)([^\\])[[:blank:]]##/${match[1]},}}"
--
1.7.7.6
reply other threads:[~2013-02-05 9:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20130205090854.GA16389@localhost.localdomain \
--to=hanpt@linux.vnet.ibm.com \
--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).