diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2002-05-03 12:49:27 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2002-05-03 12:49:27 +0000 |
commit | fed88cf8be33c787aa2ec6ca0886b1298519b269 (patch) | |
tree | 5e713f623a853db600626858ac8e2cdedd7037fe /Completion | |
parent | cebb7289266522121cd97c9327d9952e4da779fc (diff) | |
download | zsh-fed88cf8be33c787aa2ec6ca0886b1298519b269.tar.gz zsh-fed88cf8be33c787aa2ec6ca0886b1298519b269.tar.xz zsh-fed88cf8be33c787aa2ec6ca0886b1298519b269.zip |
17072: fix pushdminus handling in completion after directory stack references
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Unix/Type/_path_files | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files index aa9d87df1..df820c643 100644 --- a/Completion/Unix/Type/_path_files +++ b/Completion/Unix/Type/_path_files @@ -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 |