about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-06-26 05:22:41 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-06-26 05:22:41 +0000
commitfe43e0dae0c9d3a35c268fa320a4acf13c360794 (patch)
tree64cf0e3e1d7775ecd30036be2dcccb3462fc016a
parenta2159285e80508bb682d90a71270fbddada8bd05 (diff)
downloadzsh-fe43e0dae0c9d3a35c268fa320a4acf13c360794.tar.gz
zsh-fe43e0dae0c9d3a35c268fa320a4acf13c360794.tar.xz
zsh-fe43e0dae0c9d3a35c268fa320a4acf13c360794.zip
update.
-rw-r--r--Completion/Base/_tilde26
-rw-r--r--Completion/User/_make4
2 files changed, 26 insertions, 4 deletions
diff --git a/Completion/Base/_tilde b/Completion/Base/_tilde
index c24c65701..d03030821 100644
--- a/Completion/Base/_tilde
+++ b/Completion/Base/_tilde
@@ -7,10 +7,32 @@
 #   `(( compstate[nmatches] )) || compgen -nu -qS/'
 # below that.
 
+local c s dirs list
+
 if [[ "$SUFFIX" = */* ]]; then
   ISUFFIX="/${SUFFIX#*/}$ISUFFIX"
   SUFFIX="${SUFFIX%%/*}"
-  compgen -nu -S ''
+  s=(-S '')
 else
-  compgen -nu -qS/
+  s=(-qS/)
 fi
+
+if compset -P +; then
+  dirs="$(dirs -v)"
+  list=("${(f)dirs}")
+  [[ -o pushdminus ]] && dirs="$(awk '{ $1 = '$#list' - $1 - 1;
+  				        printf("%s\t%s\n", $1, $2); }' <<<$dirs)"
+  list=("${(@)list%	*}")
+  c=(-y '$dirs' -k "($list)")
+elif compset -P -; then
+  dirs="$(dirs -v)"
+  list=("${(f)dirs}")
+  [[ ! -o pushdminus ]] && dirs="$(awk '{ $1 = '$#list' - $1 - 1;
+					  printf("%s\t%s\n", $1, $2); }' <<<$dirs)"
+  list=("${(@)list%	*}")
+  c=(-y '$dirs' -k "($list)")
+else
+  c=(-nu)
+fi
+
+compgen "$c[@]" "$s[@]"
diff --git a/Completion/User/_make b/Completion/User/_make
index 4770c0d7a..277eae827 100644
--- a/Completion/User/_make
+++ b/Completion/User/_make
@@ -1,4 +1,4 @@
 #compdef make gmake pmake
 
-compgen -s "\$(awk '/^[a-zA-Z0-9][^\/ 	]+:/ {print \$1}' FS=: [mM]akefile /dev/null)" ||
-_files
+compgen -s "\$(awk '/^[_a-zA-Z0-9][-._a-zA-Z0-9]*[^\/ 	]+:/ {print \$1}' FS=: [mM]akefile /dev/null)" ||
+compgen -f