From 1f9bd5bcebff8f47fcc2397cd665d62765608968 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 17 Sep 1999 09:20:50 +0000 Subject: zsh-workers/7900 --- Completion/Commands/_history_complete_word | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'Completion/Commands') diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word index 76cad470f..99be0017e 100644 --- a/Completion/Commands/_history_complete_word +++ b/Completion/Commands/_history_complete_word @@ -2,9 +2,30 @@ local expl -if [[ -n "$compconfig[history_sort]" ]]; then - _description expl 'history word' +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 - _description -V expl 'history word' + 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 -compgen "$expl[@]" -Q -H 0 '' -- cgit 1.4.1