2000-02-04 17:11:15 +01:00
|
|
|
#autoload
|
|
|
|
|
|
|
|
# Try to ignore the suffix. A bit like e-o-c-prefix.
|
|
|
|
|
2000-05-08 10:16:32 +02:00
|
|
|
[[ _matcher_num -gt 1 || -z "$SUFFIX" ]] && return 1
|
2000-02-04 17:11:15 +01:00
|
|
|
|
2000-05-08 10:16:32 +02:00
|
|
|
local comp curcontext="$curcontext" tmp \
|
|
|
|
_completer _completer_num _matcher _matchers _matcher_num
|
2000-02-04 17:11:15 +01:00
|
|
|
|
|
|
|
zstyle -a ":completion:${curcontext}:" completer comp ||
|
2000-04-01 22:43:43 +02:00
|
|
|
comp=( "${(@)_completers[1,_completer_num-1][(R)_prefix(|:*),-1]}" )
|
2000-02-04 17:11:15 +01:00
|
|
|
|
|
|
|
if zstyle -t ":completion:${curcontext}:" add-space; then
|
|
|
|
ISUFFIX=" $SUFFIX"
|
|
|
|
else
|
|
|
|
ISUFFIX="$SUFFIX"
|
|
|
|
fi
|
|
|
|
SUFFIX=''
|
|
|
|
|
2000-05-08 10:16:32 +02:00
|
|
|
_completer_num=1
|
|
|
|
|
|
|
|
for tmp in "$comp[@]"; do
|
|
|
|
if [[ "$tmp" = *:-* ]]; then
|
|
|
|
_completer="${${tmp%:*}[2,-1]//_/-}${tmp#*:}"
|
|
|
|
tmp="${tmp%:*}"
|
|
|
|
elif [[ $tmp = *:* ]]; then
|
|
|
|
_completer="${tmp#*:}"
|
|
|
|
tmp="${tmp%:*}"
|
|
|
|
else
|
|
|
|
_completer="${tmp[2,-1]//_/-}"
|
|
|
|
fi
|
|
|
|
curcontext="${curcontext/:[^:]#:/:${_completer}:}"
|
|
|
|
|
|
|
|
zstyle -a ":completion:${curcontext}:" matcher-list _matchers ||
|
|
|
|
_matchers=( '' )
|
|
|
|
|
|
|
|
_matcher_num=1
|
|
|
|
for _matcher in "$_matchers[@]"; do
|
|
|
|
[[ "$tmp" != _prefix ]] && "$tmp" && return 0
|
|
|
|
(( _matcher_num++ ))
|
|
|
|
done
|
|
|
|
(( _completer_num++ ))
|
2000-02-04 17:11:15 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
return 1
|