mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-16 12:21:18 +02:00
try to improve testing for suffix style in _expand; make _path_files fail to complete words like ...<pat>..<param-subst>... (14133)
This commit is contained in:
parent
a509b259f8
commit
6f2112f23a
4 changed files with 17 additions and 15 deletions
|
@ -1,3 +1,10 @@
|
|||
2001-04-27 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 14133: Completion/Base/Completer/_expand,
|
||||
Completion/Unix/Type/_path_files, Doc/Zsh/compsys.yo: try to
|
||||
improve testing for suffix style in _expand; make _path_files
|
||||
fail to complete words like ...<pat>..<param-subst>...
|
||||
|
||||
2001-04-26 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 14129: Completion/Base/Completer/_approximate: Use a trap to
|
||||
|
|
|
@ -28,8 +28,13 @@ fi
|
|||
( "$word" = *\$[a-zA-Z0-9_]## && $+parameters[${word##*\$}] -eq 0 ) ]] &&
|
||||
return 1
|
||||
|
||||
### I'm not sure about the pattern to use in the following test.
|
||||
# It once was:
|
||||
# [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
|
||||
|
||||
zstyle -T ":completion:${curcontext}:" suffix &&
|
||||
[[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
|
||||
[[ "$word" = (\~*/|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) &&
|
||||
"${(e)word}" != *[][^~*?\<\>\{\}\|]* ]] &&
|
||||
return 1
|
||||
|
||||
zstyle -t ":completion:${curcontext}:" accept-exact ||
|
||||
|
|
|
@ -190,7 +190,7 @@ eorig="$orig"
|
|||
|
||||
# Now let's have a closer look at the string to complete.
|
||||
|
||||
if [[ "$pre" = *(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]]; then
|
||||
if [[ "$pre" = [^][*?#^\|\<\>]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]]; then
|
||||
|
||||
# If there is a parameter expansion in the word from the line, we try
|
||||
# to complete the beast by expanding the prefix and completing anything
|
||||
|
|
|
@ -1949,7 +1949,7 @@ The default is `true'.
|
|||
kindex(suffix, completion style)
|
||||
item(tt(suffix))(
|
||||
This is used by the tt(_expand) completer if the word starts with a
|
||||
tilde or parameter expansion. If it is set to `true', the word will
|
||||
tilde or contains a parameter expansion. If it is set to `true', the word will
|
||||
only be expanded if it doesn't have a suffix, i.e. if it is something
|
||||
like `tt(~foo)' or `tt($foo)', but not if it is `tt(~foo/)' or
|
||||
`tt($foo/bar)', unless that suffix itself contains characters eligible
|
||||
|
@ -2001,18 +2001,8 @@ of the tag in the context names used to look up styles. If the
|
|||
var(label) starts with a hyphen, the var(tag) is prepended to the
|
||||
var(label) to form the name used for lookup. This can be
|
||||
used to make the completion system try a certain tag more than once,
|
||||
supplying different style settings for each attempt. For example,
|
||||
|
||||
example(zstyle ':completion:*:*:-command-:*' \
|
||||
tag-order 'functions:-non-comp'
|
||||
zstyle ':completion:*:functions-non-comp' \
|
||||
ignored-patterns '_*')
|
||||
|
||||
This makes completion in command position first try only names of shell
|
||||
functions that don't match the pattern `tt(_*)'. If that generates no
|
||||
matches, the default of trying all the other things that can be
|
||||
completed in command position is used, including the names of all
|
||||
shell functions.
|
||||
supplying different style settings for each attempt, see below for an
|
||||
example.
|
||||
|
||||
The var(label) may optionally be followed by a second colon and a
|
||||
description. This description will then be used for the `tt(%d)' in
|
||||
|
|
Loading…
Reference in a new issue