1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-18 15:21:16 +02:00
zsh/Completion/Core/_message
2000-02-18 10:11:05 +00:00

25 lines
583 B
Text

#autoload
local format raw
_tags messages || return 1
if [[ "$1" = -r ]]; then
raw=yes
shift
format="$1"
else
zstyle -s ":completion:${curcontext}:messages" format format ||
zstyle -s ":completion:${curcontext}:descriptions" format format
fi
if [[ -n "$format$raw" ]]; then
[[ -z "$raw" ]] && zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}"
if [[ $compstate[nmatches] -eq 0 ]]; then
compstate[list]='list force'
compstate[insert]=''
compadd -UX "${format}" -n ''
else
compadd -X "${format}" -n '' && compstate[list]='list force'
fi
fi