zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Re: Problems with _expand
@ 2000-03-27 10:42 Sven Wischnowsky
  0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-03-27 10:42 UTC (permalink / raw)
  To: zsh-workers


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@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-03-27 10:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-27 10:42 PATCH: Re: 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).