Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Re: Problems with _expand



Oliver Kiddle wrote:

> I'm having problems with _expand in dev-20.
> 
> With the glob style set for the _expand completer things don't work anymore when expding something with ~ in it: if I do cd ~/<tab> nothing happens. I seem to remember that before, this left normal completion to go on but from tracing _expand, it seems to be trying to expand the ~ but not working. What should happen here - I'd prefer normal completion but at the very least, it should expand ~ and allow completion to carry on after that.

Hm. There was a problem with the call to _requested, making it spew
out a warning (and the other hunk fixes the suffix handling). But I
got the original and the expanded ~ all right.

Bye
 Sven

diff -ru ../z.old/Completion/Core/_expand Completion/Core/_expand
--- ../z.old/Completion/Core/_expand	Mon Mar 27 11:52:58 2000
+++ Completion/Core/_expand	Mon Mar 27 12:39:44 2000
@@ -66,7 +66,7 @@
 [[ "$sort" = (yes|true|1|on) ]] && exp=( "${(@o)exp}" )
 
 # If there is only one expansion, add a suitable suffix
-(($#exp == 1)) && suf='' && [[ -d $exp ]] && suf='/'  
+(($#exp == 1)) && suf='' && [[ -d $exp && "$exp[1]" != */ ]] && suf='/'  
 
 if [[ -z "$compstate[insert]" ]] ;then
   _description all-expansions expl 'all expansions' "o:$word"
@@ -76,8 +76,10 @@
   _tags all-expansions expansions original
 
 
-  _requested all-expansions expl 'all expansions' "o:$word" &&
-      compadd "$expl[@]" -UQ -qS "$suf" - "$exp"
+  if _requested all-expansions; then
+    _description all-expansions expl 'all expansions'
+    compadd "$expl[@]" -UQ -qS "$suf" - "$exp"
+  fi
 
   if [[ $#exp -gt 1 ]] && _requested expansions; then
     if [[ "$sort" = menu ]]; then

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author