mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-25 17:41:19 +02:00
Handle directory stack entries
This commit is contained in:
parent
ffaba98e72
commit
0956e0339a
1 changed files with 17 additions and 0 deletions
|
@ -170,6 +170,23 @@ if [[ "$pre[1]" = \~ ]]; then
|
||||||
realpath="${userdirs[$linepath]%/}/"
|
realpath="${userdirs[$linepath]%/}/"
|
||||||
elif (( $+nameddirs[$linepath] )); then
|
elif (( $+nameddirs[$linepath] )); then
|
||||||
realpath="${nameddirs[$linepath]%/}/"
|
realpath="${nameddirs[$linepath]%/}/"
|
||||||
|
elif [[ "$linepath" = [-+][0-9]## ]]; then
|
||||||
|
if [[ "$linepath" = -* ]]; then
|
||||||
|
tmp=$(( $#dirstack $linepath ))
|
||||||
|
else
|
||||||
|
tmp=$linepath[2,-1]
|
||||||
|
fi
|
||||||
|
[[ -o pushdminus ]] && tmp=$(( $#dirstack - $tmp ))
|
||||||
|
if (( ! tmp )); then
|
||||||
|
realpath=$PWD/
|
||||||
|
elif [[ tmp -le $#dirstack ]]; then
|
||||||
|
realpath=$dirstack[tmp]/
|
||||||
|
else
|
||||||
|
_message 'not directory stack entries'
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
elif [[ "$linepath" = [-+] ]]; then
|
||||||
|
realpath=${~:-\~$linepath}/
|
||||||
else
|
else
|
||||||
_message "unknown user \`$linepath'"
|
_message "unknown user \`$linepath'"
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in a new issue