1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-25 05:10:28 +02:00

17072: fix pushdminus handling in completion after directory stack references

This commit is contained in:
Oliver Kiddle 2002-05-03 12:49:27 +00:00
parent cebb728926
commit fed88cf8be
2 changed files with 12 additions and 11 deletions

View file

@ -224,20 +224,15 @@ elif [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then
realpath="${HOME%/}/"
elif [[ "$linepath" = ([-+]|)[0-9]## ]]; then
if [[ "$linepath" != [-+]* ]]; then
if [[ -o pushdminus ]]; then
tmp1="-$linepath"
else
tmp1="+$linepath"
fi
else
tmp1="$linepath"
fi
if [[ "$linepath" = -* ]]; then
tmp1=$(( $#dirstack $tmp1 ))
else
tmp1=$tmp1[2,-1]
if [[ "$linepath" = -* ]]; then
tmp1=$(( $#dirstack $linepath ))
else
tmp1=$linepath[2,-1]
fi
[[ -o pushdminus ]] && tmp1=$(( $#dirstack - $tmp1 ))
fi
[[ -o pushdminus ]] && tmp1=$(( $#dirstack - $tmp1 ))
if (( ! tmp1 )); then
realpath=$PWD/
elif [[ tmp1 -le $#dirstack ]]; then