From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: couple of problems with _expand
Date: Thu, 29 Jun 2000 10:08:29 +0200 (MET DST) [thread overview]
Message-ID: <200006290808.KAA04297@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Danek Duvall's message of Thu, 29 Jun 2000 00:18:09 -0700
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
reply other threads:[~2000-06-29 8:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200006290808.KAA04297@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).