1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-10-02 17:01:19 +02:00
zsh/Completion/Core/_prefix

24 lines
441 B
Plaintext
Raw Normal View History

2000-02-04 17:11:15 +01:00
#autoload
# Try to ignore the suffix. A bit like e-o-c-prefix.
[[ -n "$SUFFIX" ]] || return 1
2000-04-01 22:43:43 +02:00
local comp i
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=''
for i in "$comp[@]"; do
[[ "$i" != _prefix ]] && "$i" && return 0
done
return 1