mirror of
git://git.code.sf.net/p/zsh/code
synced 2026-01-01 20:11:06 +01:00
21 lines
374 B
Text
21 lines
374 B
Text
#compdef -brace-parameter-
|
|
|
|
setopt localoptions extendedglob
|
|
|
|
local lp ls n q suf=''
|
|
|
|
if [[ "$SUFFIX" = *\}* ]]; then
|
|
ISUFFIX="${SUFFIX#*\}}$ISUFFIX"
|
|
SUFFIX="${SUFFIX%%\}*}"
|
|
else
|
|
suf='} '
|
|
fi
|
|
|
|
lp="$LBUFFER[1,-${#PREFIX}-1]"
|
|
ls="$RBUFFER[${#SUFFIX}+1,-1]"
|
|
n=${(M)#ls##\"#}
|
|
q=${(M)lp%%\"#}
|
|
|
|
[[ n -gt 0 ]] && suf=''
|
|
|
|
_parameters -s "${q[1,-n-1]}" -S "$suf" -r '-:?#%+=[/'
|