Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] removing all '-g' from glob in _files
- X-seq: zsh-workers 31027
- From: Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] removing all '-g' from glob in _files
- Date: Tue, 5 Feb 2013 17:08:54 +0800
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author