1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 06:20:55 +01:00

25945: matching bug in path hierarchy completion

This commit is contained in:
Peter Stephenson 2008-10-29 21:59:32 +00:00
parent 38d2bf4af5
commit c109f9f944
2 changed files with 21 additions and 9 deletions

View file

@ -1,3 +1,10 @@
2008-10-29 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 25945: Completion/Unix/Type/_path_files: need some extra
matcher options to compadd for completing abbreviated
directory hierarchies when -U is not present (i.e. not
correcting).
2008-10-29 Peter Stephenson <pws@csr.com>
* Mikael: users/13412: Etc/relnote_4.3.7.txt: typo.

View file

@ -9,7 +9,7 @@ local pats haspats ignore pfx pfxsfx sopt gopt opt sdirs ignpar cfopt listsfx
local nm=$compstate[nmatches] menu matcher mopts sort mid accex fake
local listfiles listopts tmpdisp origtmp1 Uopt
integer npathcheck
local -a match mbegin mend
local -a match mbegin mend Mopts
typeset -U prepaths exppaths
@ -209,7 +209,12 @@ eorig="$orig"
[[ $compstate[insert] = (*menu|[0-9]*) || -n "$_comp_correct" ||
( -n "$compstate[pattern_match]" &&
"${orig#\~}" != (|*[^\\])[][*?#~^\|\<\>]* ) ]] && menu=yes
[[ -n "$_comp_correct" ]] && cfopt=- Uopt=-U
if [[ -n "$_comp_correct" ]]; then
cfopt=-
Uopt=-U
else
Mopts=(-M "r:|/=* r:|=*")
fi
# Now let's have a closer look at the string to complete.
@ -616,7 +621,7 @@ for prepath in "$prepaths[@]"; do
-p "${Uopt:+$IPREFIX}$linepath$tmp2" \
-s "/${tmp3#*/}${Uopt:+$ISUFFIX}" \
-W "$prepath$realpath$testpath" \
"$pfxsfx[@]" \
"$pfxsfx[@]" $Mopts \
$listopts \
-a tmp1
else
@ -627,7 +632,7 @@ for prepath in "$prepaths[@]"; do
-p "${Uopt:+$IPREFIX}$linepath$tmp2" \
-s "${Uopt:+$ISUFFIX}" \
-W "$prepath$realpath$testpath" \
"$pfxsfx[@]" \
"$pfxsfx[@]" $Mopts \
$listopts \
-a tmp1
fi
@ -636,7 +641,7 @@ for prepath in "$prepaths[@]"; do
compadd $Uopt -Qf "$mopts[@]" -p "${Uopt:+$IPREFIX}$linepath$tmp2" \
-s "${Uopt:+$ISUFFIX}" \
-W "$prepath$realpath$testpath" \
"$pfxsfx[@]" \
"$pfxsfx[@]" $Mopts \
$listopts \
-a tmp1
fi
@ -646,7 +651,7 @@ for prepath in "$prepaths[@]"; do
tmp4=( $Uopt -Qf "$mopts[@]" -p "${Uopt:+$IPREFIX}$linepath$tmp2"
-s "${Uopt:+$ISUFFIX}"
-W "$prepath$realpath$testpath"
"$pfxsfx[@]" )
"$pfxsfx[@]" $Mopts )
if [[ -z "$listsfx" ]]; then
for i in "$tmp1[@]"; do
tmpdisp=("${i%%/*}")
@ -666,7 +671,7 @@ for prepath in "$prepaths[@]"; do
compadd $Uopt -Qf "$mopts[@]" -p "${Uopt:+$IPREFIX}$linepath$tmp2" \
-s "${Uopt:+$ISUFFIX}" \
-W "$prepath$realpath$testpath" \
"$pfxsfx[@]" \
"$pfxsfx[@]" $Mopts \
$listopts \
-a tmp1
fi
@ -735,7 +740,7 @@ for prepath in "$prepaths[@]"; do
compadd $Uopt -Qf "$mopts[@]" -p "${Uopt:+$IPREFIX}$linepath$tmp3/" \
-s "/$tmp4$i${Uopt:+$ISUFFIX}" \
-W "$prepath$realpath${mid%/*/}/" \
"$pfxsfx[@]" $listopts - "$tmp2"
"$pfxsfx[@]" $Mopts $listopts - "$tmp2"
done
else
if [[ "$osuf" = */* ]]; then
@ -766,7 +771,7 @@ for prepath in "$prepaths[@]"; do
compadd $Uopt -Qf -p "${Uopt:+$IPREFIX}$linepath$tmp4" \
-s "${Uopt:+$ISUFFIX}" \
-W "$prepath$realpath$testpath" \
"$pfxsfx[@]" "$mopts[@]" $listopts -a tmp1
"$pfxsfx[@]" "$mopts[@]" $Mopts $listopts -a tmp1
fi
fi
fi