diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-10-26 15:36:10 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-10-26 15:36:10 +0000 |
commit | e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6 (patch) | |
tree | e4247c2507fa1a135740a3cd02e7405cbdbfa69a /Completion/Base/_tilde | |
parent | 56f338eb8bfd4bcdbf14b495ff8a34425c3527d4 (diff) | |
download | zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.gz zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.tar.xz zsh-e0b26186f1d3c1a3a580eb7e8a8199c25536f4e6.zip |
manual/8424
Diffstat (limited to 'Completion/Base/_tilde')
-rw-r--r-- | Completion/Base/_tilde | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/Completion/Base/_tilde b/Completion/Base/_tilde index d871ddc11..0b81f75a1 100644 --- a/Completion/Base/_tilde +++ b/Completion/Base/_tilde @@ -2,12 +2,7 @@ # We use all named directories and user names here. If this is too slow # for you or if there are too many of them, you may want to use -# `compgen -k friends -qS/' or something like that. To get all user names -# if there are no matches in the `friends' array, add -# `(( compstate[nmatches] )) || compgen -nu -qS/' -# below that. - -setopt localoptions extendedglob +# `compadd -qS/ - "$friends[@]"' or something like that. local d s dirs list lines revlines i @@ -20,21 +15,20 @@ else fi if [[ -prefix [-+] ]]; then - lines=(${(f)"$(dirs -v)"}) + lines=("$PWD" "$dirstack[@]") integer i if [[ ( -prefix - && ! -o pushdminus ) || ( -prefix + && -o pushdminus ) ]]; then revlines=( $lines ) for (( i = 1; i <= $#lines; i++ )); do - lines[$i]="$((i-1)) -- ${revlines[-$i]##[0-9]#[ ]#}" + lines[$i]="$((i-1)) -- ${revlines[-$i]}" done else for (( i = 1; i <= $#lines; i++ )); do - lines[$i]="$((i-1)) -- ${lines[$i]##[0-9]#[ ]#}" + lines[$i]="$((i-1)) -- ${lines[$i]}" done fi list=(${lines%% *}) - compset -P '[-+]' _description d 'directory stack' compadd "$d[@]" -V dirs -S/ -ld lines -Q - "$list[@]" @@ -45,6 +39,5 @@ else else _description d 'named directory' fi - compgen "$d[@]" -n "$s[@]" + compadd "$d[@]" "$s[@]" - "${(@k)nameddirs}" fi - |