summary refs log tree commit diff
path: root/Completion/Zsh/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-09-03 14:07:25 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-09-03 14:07:25 +0000
commit688f8b421244e4efaa6a6def242b2fa0bf5b74c5 (patch)
tree2d1395f87d651d80ea5c286f05e35bf1eefb226c /Completion/Zsh/Command
parent4284171e9e15960996e0d77d11fde1e741145c16 (diff)
downloadzsh-688f8b421244e4efaa6a6def242b2fa0bf5b74c5.tar.gz
zsh-688f8b421244e4efaa6a6def242b2fa0bf5b74c5.tar.xz
zsh-688f8b421244e4efaa6a6def242b2fa0bf5b74c5.zip
19021: in command position, try to complete directories once and once only
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r--Completion/Zsh/Command/_cd5
1 files changed, 3 insertions, 2 deletions
diff --git a/Completion/Zsh/Command/_cd b/Completion/Zsh/Command/_cd
index 306855bc8..3c19f82da 100644
--- a/Completion/Zsh/Command/_cd
+++ b/Completion/Zsh/Command/_cd
@@ -67,14 +67,15 @@ else
     # Don't complete local directories in command position, that's
     # already handled by _command_names (see _autocd)
 
-    [[ CURRENT -ne 1 ]] &&
+    [[ CURRENT -ne 1 || ( -z "$path[(r).]" && $PREFIX != */* ) ]] &&
         alt=( "${cdpath+local-}directories:${cdpath+local }directory:_path_files -/" "$alt[@]" )
 
     _alternative "$alt[@]" && ret=0
 
     return ret
   fi
-  _wanted directories expl directory _path_files -/ && ret=0
+  [[ CURRENT -ne 1 ]] && _wanted directories expl directory \
+      _path_files -/ && ret=0
 
   return ret
 fi