summary refs log tree commit diff
path: root/Completion/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Core')
-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