about summary refs log tree commit diff
path: root/Completion/Core/_oldlist
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-07-12 17:02:40 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-07-12 17:02:40 +0000
commit1f6786ef7ae24ff858f52c6d4ac2bc23d529c0c1 (patch)
tree608d6471d477e8d4d9eafa62f521be50c3248f6e /Completion/Core/_oldlist
parent7c670f1e6a0e154f0b1a2d4b6eed0e71c9404b56 (diff)
downloadzsh-1f6786ef7ae24ff858f52c6d4ac2bc23d529c0c1.tar.gz
zsh-1f6786ef7ae24ff858f52c6d4ac2bc23d529c0c1.tar.xz
zsh-1f6786ef7ae24ff858f52c6d4ac2bc23d529c0c1.zip
zsh-3.1.6-test-1 zsh-3.1.6-test-1
Diffstat (limited to 'Completion/Core/_oldlist')
-rw-r--r--Completion/Core/_oldlist24
1 files changed, 18 insertions, 6 deletions
diff --git a/Completion/Core/_oldlist b/Completion/Core/_oldlist
index f42197695..bdf12f90c 100644
--- a/Completion/Core/_oldlist
+++ b/Completion/Core/_oldlist
@@ -4,12 +4,24 @@
 # and either the compconfig key oldlist_list is `always', or it is not `never'
 # and the list is not already shown, then use the existing list for listing
 # (even if it was generated by another widget).
-if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never &&
-  $WIDGET = *list* &&
-  ( $compconfig[oldlist_list] = always || $compstate[old_list] != shown ) ]]
-then
-  compstate[old_list]=keep
-  return 0
+# Do this also if there is an old list and it was generated by the
+# completer named by the oldlist_list key.
+if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never ]]; then
+  if [[ $WIDGET = *list* &&
+        ( $compconfig[oldlist_list] = always ||
+	  $compstate[old_list] != shown ) ]]; then
+    compstate[old_list]=keep
+    return 0
+  elif [[ $compconfig[oldlist_list] = *${_lastcomp[completer]}* ]]; then
+    [[ "$_lastcomp[insert]" = unambig* ]] && compstate[to_end]=single
+    compstate[old_list]=keep
+    if [[ -o automenu ]]; then
+      compstate[insert]=menu
+    else
+      compadd -Qs "$SUFFIX" - "$PREFIX"
+    fi
+    return 0
+  fi
 fi
 
 # If this is a completion widget, and we have a completion inserted already,