about summary refs log tree commit diff
path: root/Completion/Core
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-21 09:38:36 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-21 09:38:36 +0000
commite452543d92129f9b3d5aeb72b2a3846ba4589402 (patch)
treec9bcec7e1f45ef7f242ab8faa27b54da53ad5312 /Completion/Core
parent0dab0fda771cadb96fa0cf8c242034f357f8e18b (diff)
downloadzsh-e452543d92129f9b3d5aeb72b2a3846ba4589402.tar.gz
zsh-e452543d92129f9b3d5aeb72b2a3846ba4589402.tar.xz
zsh-e452543d92129f9b3d5aeb72b2a3846ba4589402.zip
zsh-workers/9807
Diffstat (limited to 'Completion/Core')
-rw-r--r--Completion/Core/_main_complete21
1 files changed, 19 insertions, 2 deletions
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[@]" )