about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-03-24 12:35:08 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-03-24 12:35:08 +0000
commit20c5fbe688f24010c578c48d4b4d228f0e1a56c3 (patch)
treee1263f7f4d39bd07a9218ac2fa446b449194831b /Completion
parente6a2abb8dfe2e03137c82a8c13ae3bfc4c517378 (diff)
downloadzsh-20c5fbe688f24010c578c48d4b4d228f0e1a56c3.tar.gz
zsh-20c5fbe688f24010c578c48d4b4d228f0e1a56c3.tar.xz
zsh-20c5fbe688f24010c578c48d4b4d228f0e1a56c3.zip
Initial revision
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Core/_ignored32
1 files changed, 32 insertions, 0 deletions
diff --git a/Completion/Core/_ignored b/Completion/Core/_ignored
new file mode 100644
index 000000000..69a5244cc
--- /dev/null
+++ b/Completion/Core/_ignored
@@ -0,0 +1,32 @@
+#autoload
+
+# Use ignored matches.
+
+(( $compstate[ignored] )) || return 1
+
+local curcontext="${curcontext/:[^:]#:/:ignored-${(M)#_completers[1,_completer_num]:#_ignored}:}"
+local comp i _comp_no_ignore=yes tmp expl
+
+zstyle -a ":completion:${curcontext}:" completer comp ||
+  comp=( "${(@)_completers[1,_completer_num-1][(R)_ignored,-1]}" )
+
+for i in "$comp[@]"; do
+  if [[ "$i" != _ignored ]] && "$i"; then
+    if zstyle -s ":completion:${curcontext}:" single-ignored tmp &&
+       [[ $compstate[old_list] != shown && $compstate[nmatches] -eq 1 ]]; then
+      case "$tmp" in
+      show) compstate[insert]='' compstate[list]='list force' tmp='' ;;
+      menu)
+        compstate[insert]=menu
+        _description original expl original    
+        compadd "$expl[@]" -S '' - "$PREFIX$SUFFIX"
+        ;;
+      *) tmp='' ;;
+      esac
+    fi
+
+    return 0
+  fi
+done
+
+return 1