From e452543d92129f9b3d5aeb72b2a3846ba4589402 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 21 Feb 2000 09:38:36 +0000 Subject: zsh-workers/9807 --- Completion/Core/_main_complete | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'Completion/Core') diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete index c7c95cfe9..fd8d9fcb2 100644 --- a/Completion/Core/_main_complete +++ b/Completion/Core/_main_complete @@ -19,7 +19,7 @@ setopt localoptions nullglob rcexpandparam extendedglob unsetopt markdirs globsubst shwordsplit nounset ksharrays -local comp post ret=1 _compskip format _comp_ignore \ +local comp post ret=1 tmp _compskip format _comp_ignore \ _completers _completer _completer_num \ _matchers _matcher _matcher_num \ context state line opt_args val_args curcontext="$curcontext" \ @@ -80,7 +80,24 @@ for _completer; do (( _completer_num++ )) done -if [[ $compstate[nmatches] -gt 1 ]]; then +if zstyle -s ":completion:${curcontext}:" single-ignored tmp && + [[ $compstate[old_list] != shown && + $compstate[nmatches] = 0 && + $compstate[alternate_nmatches] = 1 ]]; then + case "$tmp" in + show) compstate[insert]='' compstate[list]='list force' tmp='' ;; + menu) + local expl + + compstate[insert]='menu' + _description original expl original + compadd "$expl[@]" -a -S '' - "$PREFIX$SUFFIX" + ;; + *) tmp='' ;; + esac +fi + +if [[ -n "$tmp" || $compstate[nmatches] -gt 1 ]]; then [[ _last_nmatches -ge 0 && _last_nmatches -ne compstate[nmatches] ]] && _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" ) -- cgit 1.4.1