summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-01-08 16:04:38 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-01-08 16:04:38 +0000
commit8b87aca62e72927ce2b466a60a3c0a8de8193edb (patch)
tree00d31d826a3ba6465edc41087b9ef00421fc02b9
parentc214b86e9456b2e5eda47bc7710ced0c455df70e (diff)
downloadzsh-8b87aca62e72927ce2b466a60a3c0a8de8193edb.tar.gz
zsh-8b87aca62e72927ce2b466a60a3c0a8de8193edb.zip
users/16711: try to take account of PATH_DIRS option in command completion
-rw-r--r--ChangeLog11
-rw-r--r--Completion/Unix/Type/_path_commands12
2 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f5a3a8282..b3aa12193 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-01-08 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * users/16711: Completion/Unix/Type/_path_commands: try to take
+ account of PATH_DIRS option in command completion.
+
+ * 30101: Doc/Zsh/options.yo, Src/hashtable.c, Src/options.c,
+ Src/zsh: add HASH_EXECUTABLES_ONLY option, off by default to
+ avoid problems with huge paths and remote directories.
+
2012-01-07 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 30098: Jun T.: Src/params.c: more minimal alternative to
@@ -15842,5 +15851,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5558 $
+* $Revision: 1.5559 $
*****************************************************
diff --git a/Completion/Unix/Type/_path_commands b/Completion/Unix/Type/_path_commands
index 393c0c67e..22d2aaeba 100644
--- a/Completion/Unix/Type/_path_commands
+++ b/Completion/Unix/Type/_path_commands
@@ -82,6 +82,18 @@ if [[ -n $need_desc ]]; then
else
_wanted commands expl 'external command' compadd "$@" -k commands && ret=0
fi
+if [[ -o path_dirs ]]; then
+ local -a path_dirs
+ path_dirs=(${^path}/*(/N:t))
+ (( ${#path_dirs} )) &&
+ _wanted path-dirs expl 'directory in path' compadd "$@" -a path_dirs && ret=0
+
+ if [[ $PREFIX$SUFFIX = */* ]]; then
+ # Find command from path, not hashed
+ _wanted commands expl 'external command' _path_files -W path -g '*(*)' &&
+ ret=0
+ fi
+fi
return $ret
}