diff options
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Core/_multi_parts | 3 | ||||
-rw-r--r-- | Completion/Core/_path_files | 17 |
2 files changed, 6 insertions, 14 deletions
diff --git a/Completion/Core/_multi_parts b/Completion/Core/_multi_parts index b49c41e22..392277f94 100644 --- a/Completion/Core/_multi_parts +++ b/Completion/Core/_multi_parts @@ -83,8 +83,7 @@ while true; do else # No exact match, see how many strings match what's on the line. - tmp2=( "${(@)matches%%${sep}*}" ) - compadd -O tmp1 - "$tmp2[@]" + compadd -O tmp1 - "${(@)matches%%${sep}*}" if [[ $#tmp1 -eq 1 ]]; then diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index ed799be84..16666909b 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -230,14 +230,15 @@ for prepath in "$prepaths[@]"; do if [[ -n "$PREFIX$SUFFIX" ]]; then # See which of them match what's on the line. - compadd -O tmp2 "$ignore[@]" - "${(@)tmp1##*/}" + tmp2=("$tmp1[@]") + compadd -D tmp1 "$ignore[@]" - "${(@)tmp1##*/}" # If no file matches, save the expanded path and continue with # the outer loop. - if [[ $#tmp2 -eq 0 ]]; then - if [[ "$tmp1[1]" = */* ]]; then - tmp2=( "${(@)tmp1#${prepath}${realpath}}" ) + if [[ $#tmp1 -eq 0 ]]; then + if [[ "$tmp2[1]" = */* ]]; then + tmp2=( "${(@)tmp2#${prepath}${realpath}}" ) if [[ "$tmp2[1]" = */* ]]; then exppaths=( "$exppaths[@]" ${^tmp2%/*}/${tpre}${tsuf} ) else @@ -246,14 +247,6 @@ for prepath in "$prepaths[@]"; do fi continue 2 fi - - # Remove all files that weren't matched. - - if [[ "$tmp1[1]" = */* ]]; then - tmp1=( "${(@M)tmp1:#*/(${(j:|:)~${(@)tmp2:q}})}" ) - else - tmp1=( "${(@M)tmp1:#(${(j:|:)~${(@)tmp2:q}})}" ) - fi elif (( ! $#tmp1 )); then continue 2 fi |