Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: _path_files: complete # to introduce a glob flag
- X-seq: zsh-workers 33138
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: _path_files: complete # to introduce a glob flag
- Date: Wed, 10 Sep 2014 19:30:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=j6ASqNOy8jUHwlTIdbni1wXq324RnhBb5NaiKfhEd70=; b=W18gTJGEMROCJN9dpe/sKAHfU2ecV23MDTF0uSkwKoSYcUmxJzZRKsdK0oE1jKf/Fs n1gn7j8p3+OnPN7rkVbYAllJ6LdLEbcV7SK6AfxvS1z3KeqolfTKDjIkobl6FzVpJHMJ LPrY5Kl0H0t23/KBiJfzHFkilViNWu1KRAUwaDiF7Rwr8zrRz5+4xI4BnDEFU+FjaQ8b tglVYmVzsOwU0JzUD5yahumIG4n4UPSZnd0aK6plOKxiFM+1uaYCgCSR3x/svUUkQ43n LODwc3s4ONg4I6Gi83xduuuOh8+AWtKm09VVf9EABHXmicYKNoKH8c1klebAzqhllprM xm6Q==
- In-reply-to: <1410370020-31608-1-git-send-email-mikachu@gmail.com>
- 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
- References: <1410370020-31608-1-git-send-email-mikachu@gmail.com>
On 10 September 2014 19:27, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> 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
>
Of course I'd realize just after sending, but I suppose it should also
check for extendedglob being set.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author