Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: couple of problems with _expand
- X-seq: zsh-workers 12118
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: couple of problems with _expand
- Date: Thu, 29 Jun 2000 10:08:29 +0200 (MET DST)
- In-reply-to: Danek Duvall's message of Thu, 29 Jun 2000 00:18:09 -0700
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Danek Duvall wrote:
> These are with 3.1.9-dev-1. I can replicate with zsh -f, running compinit,
> and setting the only completer to _expand.
>
> 1)
> % echo -$COL<TAB>
>
> leaves
>
> % echo -
Oops. Better don't try to expand with such a partially typed parameter
expansion.
> 2)
> % echo ${ZSH_<TAB>
> _expand:58: bad substitution
This is already fixed.
Bye
Sven
Index: Completion/Core/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v
retrieving revision 1.22
diff -u -r1.22 _expand
--- Completion/Core/_expand 2000/06/29 07:10:31 1.22
+++ Completion/Core/_expand 2000/06/29 08:07:06
@@ -33,7 +33,9 @@
word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX"
fi
-[[ "$word" = *\$\{[^\}]# ]] && return 1
+[[ "$word" = *\$(|\{[^\}]#) ||
+ ( "$word" = *\$[a-zA-Z0-9_]## && $+parameters[${word##*\$}] -eq 0 ) ]] &&
+ return 1
zstyle -T ":completion:${curcontext}:" suffix &&
[[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
@@ -44,8 +46,8 @@
{ [[ "$word" = \~(|[-+]) ||
( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ||
( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -ne 1 ) ||
- ( "$word" = \$[a-zA-Z0-9_]## &&
- ${#parameters[(I)${word[2,-1]}*]} -ne 1 ) ]] && return 1 }
+ ( "$word" = *\$[a-zA-Z0-9_]## &&
+ ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && return 1 }
# In exp we will collect the expansions.
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author