Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A couple of bugs
- X-seq: zsh-workers 10409
 
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
 
- To: zsh-workers@xxxxxxxxxxxxxx
 
- Subject: Re: A couple of bugs
 
- Date: Mon, 3 Apr 2000 13:31:50 +0200 (MET DST)
 
- In-reply-to: Oliver Kiddle's message of Mon, 03 Apr 2000 10:51:54 +0100
 
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
 
Oliver Kiddle wrote:
> ...
> 
> The second bug is that completion after ~+ or ~- seems to have been
> broken since dev-19:
>   cd ~+1/<tab>
>   unknown user `+1'
> Here I would expect file completion after the appropriate directory
> from the stack. The problem is also the case for named directories.
_path_files just wasn't able to handle the directory stack entries.
Bye
 Sven
Index: Completion/Core/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v
retrieving revision 1.3
diff -u -r1.3 _path_files
--- Completion/Core/_path_files	2000/04/03 11:05:16	1.3
+++ Completion/Core/_path_files	2000/04/03 11:30:21
@@ -170,6 +170,23 @@
     realpath="${userdirs[$linepath]%/}/"
   elif (( $+nameddirs[$linepath] )); then
     realpath="${nameddirs[$linepath]%/}/"
+  elif [[ "$linepath" = [-+][0-9]## ]]; then
+    if [[ "$linepath" = -* ]]; then
+      tmp=$(( $#dirstack $linepath ))
+    else
+      tmp=$linepath[2,-1]
+    fi
+    [[ -o pushdminus ]] && tmp=$(( $#dirstack - $tmp ))
+    if (( ! tmp )); then
+      realpath=$PWD/
+    elif [[ tmp -le $#dirstack ]]; then
+      realpath=$dirstack[tmp]/
+    else
+      _message 'not directory stack entries'
+      return 1
+    fi
+  elif [[ "$linepath" = [-+] ]]; then
+    realpath=${~:-\~$linepath}/
   else
     _message "unknown user \`$linepath'"
     return 1
--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author