about summary refs log tree commit diff
path: root/Completion/Core/_menu
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-05-02 15:20:46 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-05-02 15:20:46 +0000
commit5d0a0edccae5f20868653bf44321d3d2cac2ef11 (patch)
tree63a35b34e6d466489aeefd8f74bcc01f444fdd35 /Completion/Core/_menu
parente8eb43fc308acb3f1a8ebada7633c097e5050e46 (diff)
downloadzsh-5d0a0edccae5f20868653bf44321d3d2cac2ef11.tar.gz
zsh-5d0a0edccae5f20868653bf44321d3d2cac2ef11.tar.xz
zsh-5d0a0edccae5f20868653bf44321d3d2cac2ef11.zip
Initial revision
Diffstat (limited to 'Completion/Core/_menu')
-rw-r--r--Completion/Core/_menu21
1 files changed, 21 insertions, 0 deletions
diff --git a/Completion/Core/_menu b/Completion/Core/_menu
new file mode 100644
index 000000000..4cbda4e14
--- /dev/null
+++ b/Completion/Core/_menu
@@ -0,0 +1,21 @@
+#autoload
+
+# This completer is an example showing how menucompletion can be
+# implemented with the new completion system.
+# Use this one before the normal _complete completer, as in:
+#
+#   compconf completer=_menu:_complete
+
+if [[ -n "$compstate[old_list]" ]]; then
+
+  # We have an old list, keep it and insert the next match.
+
+  compstate[old_list]=keep
+  compstate[insert]=$((compstate[old_insert]+1))
+else
+  # No old list, make completion insert the first match.
+
+  compstate[insert]=1
+fi
+
+return 1