about summary refs log tree commit diff
path: root/Completion/Core/_ignored
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-08 08:16:32 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-08 08:16:32 +0000
commit92637abbb870dc35e1af9150741f7b11587a3350 (patch)
tree0720a090889ec58db87992e6a4e9712a1c939739 /Completion/Core/_ignored
parentc15091b7d196c8fcc15bf8f13f8c7ccf62479b85 (diff)
downloadzsh-92637abbb870dc35e1af9150741f7b11587a3350.tar.gz
zsh-92637abbb870dc35e1af9150741f7b11587a3350.tar.xz
zsh-92637abbb870dc35e1af9150741f7b11587a3350.zip
misc. completion cleanups and changes (11242)
Diffstat (limited to 'Completion/Core/_ignored')
-rw-r--r--Completion/Core/_ignored58
1 files changed, 41 insertions, 17 deletions
diff --git a/Completion/Core/_ignored b/Completion/Core/_ignored
index 4046f4c2d..61d6d3ea5 100644
--- a/Completion/Core/_ignored
+++ b/Completion/Core/_ignored
@@ -2,30 +2,54 @@
 
 # Use ignored matches.
 
-(( $compstate[ignored] )) || return 1
+[[ _matcher_num -gt 1 || $compstate[ignored] -eq 0 ]] && return 1
 
-local comp i _comp_no_ignore=yes tmp expl
+local comp _comp_no_ignore=yes tmp expl \
+      _completer _completer_num _matcher _matchers _matcher_num
 
 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
+_completer_num=1
 
-    return 0
+for tmp in "$comp[@]"; do
+  if [[ "$tmp" = *:-* ]]; then
+    _completer="${${tmp%:*}[2,-1]//_/-}${tmp#*:}"
+    tmp="${tmp%:*}"
+  elif [[ $tmp = *:* ]]; then
+    _completer="${tmp#*:}"
+    tmp="${tmp%:*}"
+  else
+    _completer="${tmp[2,-1]//_/-}"
   fi
+  curcontext="${curcontext/:[^:]#:/:${_completer}:}"
+
+  zstyle -a ":completion:${curcontext}:" matcher-list _matchers ||
+      _matchers=( '' )
+
+  _matcher_num=1
+  for _matcher in "$_matchers[@]"; do
+    if [[ "$tmp" != _ignored ]] && "$tmp"; 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"
+          ;;
+        esac
+      fi
+
+      return 0
+    fi
+
+    (( _matcher_num++ ))
+  done
+
+  (( _completer_num++ ))
 done
 
 return 1