1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-12 11:01:15 +02:00
zsh/Completion/Commands/_history_complete_word
1999-09-17 09:20:50 +00:00

31 lines
831 B
Text

#compdef -k complete-word \e/
local expl
if [[ -n "$compstate[old_list]" && -n "$compconfig[history_stop]" ]]; then
if [[ -z "$_hist_menu_end" &&
compstate[old_insert] -lt _hist_menu_length ]]; then
compstate[old_list]=keep
compstate[insert]=$((compstate[old_insert]+1))
else
_hist_menu_end=yes
if [[ "$compconfig[history_stop]" = verbose ]]; then
_message 'end of history reached'
else
compstate[old_list]=keep
compstate[insert]=_hist_menu_length
fi
fi
else
if [[ -n "$compconfig[history_sort]" ]]; then
_description expl 'history word'
else
_description -V expl 'history word'
fi
compgen "$expl[@]" -Q -H 0 ''
compstate[insert]=1
if [[ -n "$compconfig[history_stop]" ]]; then
_hist_menu_length="$compstate[nmatches]"
_hist_menu_end=''
fi
fi