* [PATCH] removing all '-g' from glob in _files
@ 2013-02-05 9:08 Han Pingtian
0 siblings, 0 replies; only message in thread
From: Han Pingtian @ 2013-02-05 9:08 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-02-05 9:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-05 9:08 [PATCH] removing all '-g' from glob in _files Han Pingtian
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).