summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-12 09:28:56 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-12 09:28:56 +0000
commit5de84477acd1abe1f192547ea22c46bcca9be63c (patch)
tree2e52416b7fe8f9944828724a8129cc2d2f4dc6e6 /Completion
parent5ac242f44924ab4f165326fba5f4d6bf8af29626 (diff)
downloadzsh-5de84477acd1abe1f192547ea22c46bcca9be63c.tar.gz
zsh-5de84477acd1abe1f192547ea22c46bcca9be63c.tar.xz
zsh-5de84477acd1abe1f192547ea22c46bcca9be63c.zip
keep _oldlist from using the dummy match inserted for warnings (10691)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Core/_main_complete8
-rw-r--r--Completion/Core/_oldlist1
2 files changed, 6 insertions, 3 deletions
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