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

PATCH: _cd



This discussion about `don't always include the directoies from
cdpath' made me think that this probably should be configurable in the 
new system. I haven't done that yet, though, because maybe this could
be done together with the other changes for `_files' (using the same
config key, I mean). And btw. this config key (`path_merge_*' or
whatever) should probably allow to define this on a per-command and/or 
per-pattern basis. Which almost looks like a task for an array or
association. Hm.

Anyway. With cdablevars set doing `cd <TAB>' gave me `cd wischnow'.

Rather irritating that.

Bye
 Sven

diff -u oldcompletion/Builtins/_cd Completion/Builtins/_cd
--- oldcompletion/Builtins/_cd	Fri Sep 17 09:32:39 1999
+++ Completion/Builtins/_cd	Fri Sep 17 11:24:21 1999
@@ -67,7 +67,7 @@
   # variable names, but it hardly seems worth it.
   # Note we need a tilde because cdablevars also allows user home
   # directories, hence we also need nonomatch to suppress error messages.
-  if [[ -o cdablevars && ! -d ${tdir::=${PREFIX%%/*}} &&
+  if [[ -o cdablevars && -n "$PREFIX" && ! -d ${tdir::=${PREFIX%%/*}} &&
     -d ${~tdir2::="~$tdir"} ]]; then
       PREFIX="~$PREFIX"
       _path_files -/

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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