mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-03 22:32:12 +02:00
18822: fix accept-exact style not not bail out when it shouldn't and add a
setting to continue on and do normal completion
This commit is contained in:
parent
f92a529edc
commit
3ac50886a0
3 changed files with 20 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
|||
2003-07-07 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 18822: Completion/Base/Completer/_expand, Doc/Zsh/compsys.yo:
|
||||
fix accept-exact style not not bail out when it shouldn't and
|
||||
add a setting to continue on and do normal completion
|
||||
|
||||
2003-07-07 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 18xxx: Completion/Unix/Command/_subversion: completion for
|
||||
|
|
|
@ -12,6 +12,7 @@ setopt localoptions nonomatch
|
|||
[[ _matcher_num -gt 1 ]] && return 1
|
||||
|
||||
local exp word sort expr expl subd suf=" " force opt asp tmp opre pre epre
|
||||
local continue=0
|
||||
|
||||
(( $# )) &&
|
||||
while getopts gsco opt; do
|
||||
|
@ -37,13 +38,17 @@ zstyle -T ":completion:${curcontext}:" suffix &&
|
|||
"${(e)word}" != *[][^*?\(\)\<\>\{\}\|]* ]] &&
|
||||
return 1
|
||||
|
||||
zstyle -t ":completion:${curcontext}:" accept-exact ||
|
||||
[[ $? -eq 2 && ! -o recexact ]] ||
|
||||
zstyle -s ":completion:${curcontext}:" accept-exact tmp ||
|
||||
[[ ! -o recexact ]] || tmp=1
|
||||
|
||||
if [[ "$tmp" != (yes|true|on|1) ]]; then
|
||||
{ [[ "$word" = \~(|[-+]) ||
|
||||
( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ||
|
||||
( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -ne 1 ) ||
|
||||
( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ]] && return 1 }
|
||||
{ [[ ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -gt 1 ) ||
|
||||
( "$word" = *\$[a-zA-Z0-9_]## &&
|
||||
${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && return 1 }
|
||||
${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && continue=1 }
|
||||
[[ continue -eq 1 && "$tmp" != continue ]] && return 1
|
||||
fi
|
||||
|
||||
# In exp we will collect the expansions.
|
||||
|
||||
|
@ -217,4 +222,4 @@ else
|
|||
compstate[insert]=menu
|
||||
fi
|
||||
|
||||
return 0
|
||||
return continue
|
||||
|
|
|
@ -1034,7 +1034,9 @@ words beginning with a tilde or parameter expansion should be
|
|||
expanded. For example, if there are parameters
|
||||
tt(foo) and tt(foobar), the string `tt($foo)' will only be expanded if
|
||||
tt(accept-exact) is set to `true'; otherwise the completion system will
|
||||
be allowed to complete tt($foo) to tt($foobar).
|
||||
be allowed to complete tt($foo) to tt($foobar). If the style is set to
|
||||
`continue', _expand will add the expansion as a match and the completion
|
||||
system will also be allowed to continue.
|
||||
)
|
||||
kindex(add-space, completion style)
|
||||
item(tt(add-space))(
|
||||
|
|
Loading…
Reference in a new issue