about summary refs log tree commit diff
path: root/Completion/Core/_setup
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Core/_setup')
-rw-r--r--Completion/Core/_setup12
1 files changed, 11 insertions, 1 deletions
diff --git a/Completion/Core/_setup b/Completion/Core/_setup
index dfd1b4127..bdef1bf8e 100644
--- a/Completion/Core/_setup
+++ b/Completion/Core/_setup
@@ -1,6 +1,6 @@
 #autoload
 
-local val
+local val nm="$compstate[nmatches]"
 
 if _style -a "$1" list-colors val; then
   if [[ "$1" = default ]]; then
@@ -49,3 +49,13 @@ if _style -s "$1" accept-exact val; then
 else
   compstate[exact]="$_saved_exact"
 fi
+
+[[ _last_nmatches -ge 0 && _last_nmatches -ne nm ]] &&
+    _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" )
+
+if _style -a "$1" menu val; then
+  _last_nmatches="$nm"
+  _last_menu_style=( "$val[@]" )
+else
+  _last_nmatches=-1
+fi