aboutsummaryrefslogtreecommitdiff
path: root/Completion/Base/_brace_parameter
blob: f688e175a8557b31cc07e54dc2c1a16360b93809 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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%%\"#}

_parameters -s "${q[1,-n-1]}" -S "$suf" -r '-:?#%+=[/'