diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-25 15:43:41 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-25 15:43:41 +0000 |
commit | 206237c8ec4b7619d9e70a75004cd1ae1066b0a0 (patch) | |
tree | ff703cbc295605f90755edb68672ed2de11f4a81 /Completion/Core/_path_files | |
parent | 8ceb54fbc2f879e0e80f58c18761bd54db07e5f7 (diff) | |
download | zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.gz zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.xz zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.zip |
zsh-3.1.5-pws-16 zsh-3.1.5-pws-16-w6109 dot-zsh-199904280524
Diffstat (limited to 'Completion/Core/_path_files')
-rw-r--r-- | Completion/Core/_path_files | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 21837ade2..ed799be84 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -153,7 +153,7 @@ if [[ "$pre[1]" = \~ ]]; then # prefix path by setting `prepaths'. linepath="${pre%%/*}/" - eval realpath\=$linepath + realpath=$~linepath [[ "$realpath" = "$linepath" ]] && return 1 pre="${pre#*/}" orig="${orig#*/}" @@ -236,8 +236,14 @@ for prepath in "$prepaths[@]"; do # the outer loop. if [[ $#tmp2 -eq 0 ]]; then - [[ "$tmp1[1]" = */* ]] && - exppaths=( "$exppaths[@]" ${^tmp1%/*}/${tpre}${tsuf} ) + if [[ "$tmp1[1]" = */* ]]; then + tmp2=( "${(@)tmp1#${prepath}${realpath}}" ) + if [[ "$tmp2[1]" = */* ]]; then + exppaths=( "$exppaths[@]" ${^tmp2%/*}/${tpre}${tsuf} ) + else + exppaths=( "$exppaths[@]" ${tpre}${tsuf} ) + fi + fi continue 2 fi @@ -249,8 +255,6 @@ for prepath in "$prepaths[@]"; do tmp1=( "${(@M)tmp1:#(${(j:|:)~${(@)tmp2:q}})}" ) fi elif (( ! $#tmp1 )); then - [[ "$tmp1[1]" = */* ]] && - exppaths=( "$exppaths[@]" ${^tmp1%/*}/${tpre}${tsuf} ) continue 2 fi @@ -375,8 +379,8 @@ exppaths=( "${(@)exppaths:#$orig}" ) if [[ -n "$compconfig[path_expand]" && $#exppaths -ne 0 && nm -eq compstate[nmatches] ]]; then - compadd -U -S '' "$group[@]" "$expl[@]" -i "$IPREFIX" -I "$ISUFFIX" - \ - "${(@)exppaths}" + compadd -U -S '' "$group[@]" "$expl[@]" -i "$IPREFIX" -I "$ISUFFIX" \ + -p "$linepath" - "${(@)exppaths}" fi [[ nm -eq compstate[nmatches] ]] |