Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _path_files: complete # to introduce a glob flag
- X-seq: zsh-workers 33137
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: _path_files: complete # to introduce a glob flag
- Date: Wed, 10 Sep 2014 19:27:00 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=LYFL8IFHaCSKo+p4wzOkh5iArifo+QBX60Xd1diHT7M=; b=rq+JbBQZ0bN68K01Qd8AY3lYCq+BqprkfaDTvolKKrberRLnm6GyynXCvJ9onWQKCq sUjjZT3+lAeIYEfSZb+aybTFP0Qry39uPNLbxcnCrJmnubhVYQOpn9a73B6Cm6mS4JXa JRpEVignW6MZ58j2dUHYJY1w/wwpKP/ofR5Boatl2Dj0rd8ZuSL4dAvefMyp9XjvbAGb 4OVClfGs78AizEeX+LuU7TYsgvuQ64UqlHj6q9WiYRXSe3/fPgZimGjWWRAZNDZ2ZALe 1RHRInJM+epqp634T1vyBhoQxiO98O80iX1m5PqFJDMkZgiClZQYKkVnCkoxDfJafy4L g/RA==
- 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
This adds # as a possible completion at the *(<tab> point. *(#<tab> is already handled obviously, but you had to know to type it.
---
Completion/Unix/Type/_path_files | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 8b8d5d5..b0725ba 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -15,13 +15,19 @@ 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
+ local -a flags
+ flags=(
+ '#:introduce glob flag'
+ )
+ _globquals && ret=0
+ _describe -t globflags "glob flag" flags -Q -S '' && ret=0
+ fi
+ return ret
fi
# Utility function for in-path completion. This allows `/u/l/b<TAB>'
--
1.9.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author