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

Re: A couple of bugs



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