1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-22 04:31:14 +02:00

make expand style (file completion) work again; no more special behaviour with menu completion; try to make docs clearer (15944)

This commit is contained in:
Sven Wischnowsky 2001-10-05 11:18:36 +00:00
parent 7a1139b5e0
commit 22d506ed6b
3 changed files with 22 additions and 9 deletions

View file

@ -1,3 +1,9 @@
2001-10-05 Sven Wischnowsky <wischnow@zsh.org>
* 15944: Completion/Unix/Type/_path_files, Doc/Zsh/compsys.yo:
make expand style (file completion) work again; no more special
behaviour with menu completion; try to make docs clearer
2001-10-05 Geoff Wing <gcw@zsh.org> 2001-10-05 Geoff Wing <gcw@zsh.org>
* unposted: Doc/Zsh/options.yo: typo * unposted: Doc/Zsh/options.yo: typo

View file

@ -332,6 +332,8 @@ for prepath in "$prepaths[@]"; do
# Get the matching files by globbing. # Get the matching files by globbing.
tmp2=( "$tmp1[@]" )
if [[ "$tpre$tsuf" = */* ]]; then if [[ "$tpre$tsuf" = */* ]]; then
compfiles -P$cfopt tmp1 accex "$skipped" "$_matcher" "$sdirs" fake compfiles -P$cfopt tmp1 accex "$skipped" "$_matcher" "$sdirs" fake
elif [[ "$sopt" = *[/f]* ]]; then elif [[ "$sopt" = *[/f]* ]]; then
@ -344,7 +346,9 @@ for prepath in "$prepaths[@]"; do
if [[ -n "$PREFIX$SUFFIX" ]]; then if [[ -n "$PREFIX$SUFFIX" ]]; then
# See which of them match what's on the line. # See which of them match what's on the line.
if [[ "$tmp1[1]" = */* ]]; then if (( ! $#tmp1 )); then
tmp2=( ${^tmp2}/$PREFIX$SUFFIX )
elif [[ "$tmp1[1]" = */* ]]; then
if [[ -n "$_comp_correct" ]]; then if [[ -n "$_comp_correct" ]]; then
tmp2=( "$tmp1[@]" ) tmp2=( "$tmp1[@]" )
builtin compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp1:t}" builtin compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp1:t}"
@ -505,12 +509,15 @@ for prepath in "$prepaths[@]"; do
SUFFIX="$osuf" SUFFIX="$osuf"
fi fi
if [[ -n $menu || -z "$compstate[insert]" ]] || # This once tested `-n $menu ||' but our menu-completion expert says
! zstyle -t ":completion:${curcontext}:paths" expand suffix || # that's not what we want.
if [[ -z "$compstate[insert]" ]] ||
{ ! zstyle -t ":completion:${curcontext}:paths" expand suffix &&
[[ -z "$listsfx" && [[ -z "$listsfx" &&
( -n "$_comp_correct" || ( -n "$_comp_correct" ||
-z "$compstate[pattern_match]" || "$SUFFIX" != */* || -z "$compstate[pattern_match]" || "$SUFFIX" != */* ||
"${SUFFIX#*/}" = (|*[^\\])[][*?#~^\|\<\>]* ) ]]; then "${SUFFIX#*/}" = (|*[^\\])[][*?#~^\|\<\>]* ) ]] }; then
(( tmp4 )) && zstyle -t ":completion:${curcontext}:paths" ambiguous && (( tmp4 )) && zstyle -t ":completion:${curcontext}:paths" ambiguous &&
compstate[to_end]= compstate[to_end]=
if [[ "$tmp3" = */* ]]; then if [[ "$tmp3" = */* ]]; then

View file

@ -1070,15 +1070,15 @@ the file tt(/etc/resolv.conf).
kindex(expand, completion style) kindex(expand, completion style)
item(tt(expand))( item(tt(expand))(
This style is used when completing strings consisting of multiple This style is used when completing strings consisting of multiple
parts, such as path names. If its parts, such as path names. If one of its values is
value contains the string `tt(prefix)', the partially typed word from the string `tt(prefix)', the partially typed word from
the line will be expanded as far as possible even if trailing parts the line will be expanded as far as possible even if trailing parts
cannot be completed. If it contains the string `tt(suffix)' cannot be completed. If one of its values is the string `tt(suffix)',
and normal (non-menu-) completion is used, matching names for matching names for
components after the first ambiguous one will also be added. This components after the first ambiguous one will also be added. This
means that the resulting string is the longest unambiguous string means that the resulting string is the longest unambiguous string
possible, but if menu completion is started on the list of matches possible, but if menu completion is started on the list of matches
generated this way (e.g. due to the option tt(AUTO_MENU) being set), generated this way,
this will also cycle through the names of the files in pathname this will also cycle through the names of the files in pathname
components after the first ambiguous one. components after the first ambiguous one.
) )