mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-03 10:21:46 +02:00
25 lines
527 B
Text
25 lines
527 B
Text
if [[ $1 = n ]]; then
|
|
if [[ $2 = <-> ]]; then
|
|
# Recent directory
|
|
typeset -ga reply
|
|
autoload -Uz cdr
|
|
cdr -r
|
|
if [[ -n ${reply[$2]} ]]; then
|
|
reply=(${reply[$2]})
|
|
return 0
|
|
else
|
|
reply=()
|
|
return 1
|
|
fi
|
|
fi
|
|
elif [[ $1 = c ]]; then
|
|
if [[ $PREFIX = <-> || -z $PREFIX ]]; then
|
|
typeset -a keys values
|
|
values=(${${(f)"$(cdr -l)"}/ ##/:})
|
|
keys=(${values%%:*})
|
|
_describe -t dir-index 'recent directory index' \
|
|
values -V unsorted -S']'
|
|
return
|
|
fi
|
|
fi
|
|
return 1
|