* PATCH: Re: couple of problems with _expand
@ 2000-06-29 8:08 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-06-29 8:08 UTC (permalink / raw)
To: zsh-workers
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-06-29 8:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-29 8:08 PATCH: Re: couple of problems with _expand Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).