mirror of
https://git.code.sf.net/p/zsh/code
synced 2026-04-18 06:53:35 -04:00
54251: complete names containing dot only after ${
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2026-03-30 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||
|
||||
* 54251: Completion/Zsh/Type/_parameters: complete names with
|
||||
dot (such as .namespace.param) only after ${
|
||||
|
||||
2026-03-26 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||
|
||||
* Stéphane Blondon: 54246: Completion/Zsh/Function/_zcalc:
|
||||
|
||||
@@ -10,15 +10,19 @@ local i pfilt
|
||||
local -i nm=$compstate[nmatches]
|
||||
local -a expl pattern=( -g \* ) normal described verbose faked fakes tmp
|
||||
|
||||
# parameter names that match the pattern $pfilt are removed
|
||||
zstyle -t ":completion:${curcontext}:parameters" prefix-needed &&
|
||||
[[ $PREFIX != [_.]* ]] &&
|
||||
pfilt='[^_.]'
|
||||
pfilt='[_.]*'
|
||||
# names containing a dot are allowed only within ${ }
|
||||
[[ $IPREFIX != \${* ]] && pfilt+='|*.*'
|
||||
|
||||
_description parameters expl parameter
|
||||
zparseopts -D -K -E g:=pattern
|
||||
|
||||
if zstyle -t ":completion:${curcontext}:parameters" extra-verbose; then
|
||||
described=(
|
||||
"${(@M)${(@k)parameters[(R)$~pattern[2]~*(hideval|local|special)*]}:#$~pfilt*}"
|
||||
${(k)parameters[(R)$~pattern[2]~*(hideval|local|special)*]:#$~pfilt}
|
||||
)
|
||||
compadd "$@" "$expl[@]" -D described -a - described
|
||||
if (( $#described )); then
|
||||
@@ -33,10 +37,10 @@ if zstyle -t ":completion:${curcontext}:parameters" extra-verbose; then
|
||||
fi
|
||||
|
||||
normal=(
|
||||
"${(@M)${(@k)parameters[(R)$~pattern[2]~^(*(hideval|special)*)~*local*]}:#$~pfilt*}"
|
||||
${(k)parameters[(R)$~pattern[2]~^(*(hideval|special)*)~*local*]:#$~pfilt}
|
||||
)
|
||||
else
|
||||
normal=( "${(@M)${(@k)parameters[(R)$~pattern[2]~*local*]}:#$~pfilt*}" )
|
||||
normal=( ${(k)parameters[(R)${~pattern[2]}~*local*]:#$~pfilt} )
|
||||
fi
|
||||
|
||||
if zstyle -a ":completion:${curcontext}:" fake-parameters tmp; then
|
||||
|
||||
Reference in New Issue
Block a user