about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Core/_main_complete8
-rw-r--r--Completion/Core/_oldlist1
3 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index da48708ba..51ff1aced 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-04-12  Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
 
+	* 10691: Completion/Core/_main_complete, Completion/Core/_oldlist:
+ 	keep _oldlist from using the dummy match inserted for warnings
+	
 	* 10690: Doc/Zsh/compwid.yo, Src/Zle/compcore.c, Src/Zle/compctl.c,
  	Src/Zle/compresult.c: comment out the code to allow
  	$compstate[insert] to select the group
diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete
index 90bdef648..795fe7442 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 func funcs ret=1 tmp _compskip format \
+local func funcs ret=1 tmp _compskip format nm \
       _completers _completer _completer_num curtag \
       _matchers _matcher _matcher_num _comp_tags \
       context state line opt_args val_args curcontext="$curcontext" \
@@ -105,8 +105,9 @@ for tmp in "$_completers[@]"; do
 done
 
 curcontext="${curcontext/:[^:]#:/::}"
+nm=$compstate[nmatches]
 
-if [[ $compstate[old_list] = keep || $compstate[nmatches] -gt 1 ]]; then
+if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then
   [[ _last_nmatches -ge 0 && _last_nmatches -ne $compstate[nmatches] ]] &&
       _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" )
 
@@ -160,7 +161,7 @@ if [[ $compstate[old_list] = keep || $compstate[nmatches] -gt 1 ]]; then
       fi
     fi
   fi
-elif [[ $compstate[nmatches] -eq 0 &&
+elif [[ nm -eq 0 &&
         $#_lastdescr -ne 0 && $compstate[old_list] != keep ]] &&
      zstyle -s ":completion:${curcontext}:warnings" format format; then
 
@@ -195,6 +196,7 @@ for func in "$funcs[@]"; do
 done
 
 _lastcomp=( "${(@kv)compstate}" )
+_lastcomp[nmatches]=$nm
 _lastcomp[completer]="$_completer"
 _lastcomp[prefix]="$PREFIX"
 _lastcomp[suffix]="$SUFFIX"
diff --git a/Completion/Core/_oldlist b/Completion/Core/_oldlist
index 04e952655..899a5b1ba 100644
--- a/Completion/Core/_oldlist
+++ b/Completion/Core/_oldlist
@@ -35,6 +35,7 @@ fi
 # existing list (even if it was generated by another widget).
 
 if [[ -z $compstate[old_insert] && -n $compstate[old_list] &&
+      ( $_lastcomp[nmatches] -ne 0 || $WIDGET != $LASTWIDGET ) &&
       $LASTWIDGET != _complete_help && $WIDGET != _complete_help ]]; then
   compstate[old_list]=keep
   return 0