summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2013-05-18 11:24:49 +0200
committerMikael Magnusson <mikachu@gmail.com>2014-09-16 00:32:14 +0200
commitcd09b8162673c44dc0984dc18da3c98beda550cc (patch)
treedbd89b1ee61484f192eb96c894bdc2bd8f78d3d6
parent78dd672e1a8550f93ccd586b6a9ad35369c796f7 (diff)
downloadzsh-cd09b8162673c44dc0984dc18da3c98beda550cc.tar.gz
zsh-cd09b8162673c44dc0984dc18da3c98beda550cc.zip
33137: _path_files: complete # to introduce a glob flag
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Type/_path_files22
2 files changed, 18 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 01db3d53d..a06461fa3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* 33136: Doc/Zsh/expn.yo, Src/glob.c: P glob qualifier appends
words when negated.
+ * 33137: Completion/Unix/Type/_path_files: complete # to introduce
+ a glob flag
+
2014-09-14 Marc Finet <m.dreadlock@gmail.com>
* 33149: Misc/vcs_info-examples: vcs_info examples: fix typo
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 85feae54c..ed3f54de3 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -15,13 +15,21 @@ local -a match mbegin mend
# a bare glob qualifier.
# The later test looks for an outstanding quote.
if _have_glob_qual $PREFIX; then
- compset -p ${#match[1]}
- if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then
- _globflags
- else
- _globquals
- fi
- return
+ local ret=1
+ compset -p ${#match[1]}
+ if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then
+ _globflags && ret=0
+ else
+ if [[ $_comp_caller_options[extendedglob] == on ]]; then
+ local -a flags
+ flags=(
+ '#:introduce glob flag'
+ )
+ _describe -t globflags "glob flag" flags -Q -S '' && ret=0
+ fi
+ _globquals && ret=0
+ fi
+ return ret
fi
# Utility function for in-path completion. This allows `/u/l/b<TAB>'