mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-18 15:21:16 +02:00
moved from Completion/Core/_menu
This commit is contained in:
parent
f347145efc
commit
382d03c17d
1 changed files with 23 additions and 0 deletions
23
Completion/Base/Completer/_menu
Normal file
23
Completion/Base/Completer/_menu
Normal file
|
@ -0,0 +1,23 @@
|
|||
#autoload
|
||||
|
||||
[[ _matcher_num -gt 1 ]] && return 1
|
||||
|
||||
# This completer is an example showing how menucompletion can be
|
||||
# implemented with the new completion system.
|
||||
# Use this one before the normal _complete completer, as in:
|
||||
#
|
||||
# zstyle ":completion:::::" completer _menu _complete
|
||||
|
||||
if [[ -n "$compstate[old_list]" ]]; then
|
||||
|
||||
# We have an old list, keep it and insert the next match.
|
||||
|
||||
compstate[old_list]=keep
|
||||
compstate[insert]=$((compstate[old_insert]+1))
|
||||
else
|
||||
# No old list, make completion insert the first match.
|
||||
|
||||
compstate[insert]=1
|
||||
fi
|
||||
|
||||
return 1
|
Loading…
Reference in a new issue