zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: Problems with _expand
Date: Mon, 27 Mar 2000 12:42:31 +0200 (MET DST)	[thread overview]
Message-ID: <200003271042.MAA03959@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Oliver Kiddle's message of Sun, 26 Mar 2000 14:50:14 +0100


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


                 reply	other threads:[~2000-03-27 10:42 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=200003271042.MAA03959@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).