diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-19 11:18:05 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-19 11:18:05 +0000 |
commit | 9867c4091e71e6ed69889a9bfaee07275d2fa04e (patch) | |
tree | 37318116ff90f7b90df7cb9e894790d96be0849b /Completion/Builtins/_cd | |
parent | 04979daf4f9b9645f22df1dfbb5974ab82294868 (diff) | |
download | zsh-9867c4091e71e6ed69889a9bfaee07275d2fa04e.tar.gz zsh-9867c4091e71e6ed69889a9bfaee07275d2fa04e.tar.xz zsh-9867c4091e71e6ed69889a9bfaee07275d2fa04e.zip |
manual/7448
Diffstat (limited to 'Completion/Builtins/_cd')
-rw-r--r-- | Completion/Builtins/_cd | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Completion/Builtins/_cd b/Completion/Builtins/_cd index 9ac29b8f8..92a14ec31 100644 --- a/Completion/Builtins/_cd +++ b/Completion/Builtins/_cd @@ -14,6 +14,8 @@ emulate -L zsh setopt extendedglob nonomatch +local expl + if [[ CURRENT -eq 3 ]]; then # cd old new: look for old in $PWD and see what can replace it local rep @@ -21,7 +23,8 @@ if [[ CURRENT -eq 3 ]]; then rep=(${~PWD/$words[2]/*}~$PWD(-/N)) # Now remove all the common parts of $PWD and the completions from this rep=(${${rep#${PWD%%$words[2]*}}%${PWD#*$words[2]}}) - (( ! $#rep )) || compadd $rep + _description expl replacement + (( ! $#rep )) || compadd "$expl[@]" $rep elif [[ $PREFIX = [-+]* ]]; then # pushd: just complete the numbers, but show the full directory list with # numbers. @@ -50,7 +53,8 @@ elif [[ $PREFIX = [-+]* ]]; then lines="${(F)list}" # get the array of numbers only list=(${list%%[ ]*}) - compgen -y '$lines' -Q -k list && ret=0 + _description expl 'directory stack index' + compgen "$expl[@]" -y '$lines' -Q -k list && ret=0 [[ -z $compstate[list] ]] && compstate[list]=list && ret=0 [[ -n $compstate[insert] ]] && compstate[insert]=menu && ret=0 |