about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-07-07 09:48:45 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-07-07 09:48:45 +0000
commit3ac50886a00231cf99c421f4e36bbc356c91cea2 (patch)
tree94afe64194e7454330740679c28e4d1d92f47128 /Completion/Base
parentf92a529edc79d74ac0aa6c3b05a5824465d2cf29 (diff)
downloadzsh-3ac50886a00231cf99c421f4e36bbc356c91cea2.tar.gz
zsh-3ac50886a00231cf99c421f4e36bbc356c91cea2.tar.xz
zsh-3ac50886a00231cf99c421f4e36bbc356c91cea2.zip
18822: fix accept-exact style not not bail out when it shouldn't and add a
setting to continue on and do normal completion
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/Completer/_expand17
1 files changed, 11 insertions, 6 deletions
diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand
index 0e7b5820c..a71c7d34b 100644
--- a/Completion/Base/Completer/_expand
+++ b/Completion/Base/Completer/_expand
@@ -12,6 +12,7 @@ setopt localoptions nonomatch
 [[ _matcher_num -gt 1 ]] && return 1
 
 local exp word sort expr expl subd suf=" " force opt asp tmp opre pre epre
+local continue=0
 
 (( $# )) &&
     while getopts gsco opt; do
@@ -37,13 +38,17 @@ zstyle -T ":completion:${curcontext}:" suffix &&
      "${(e)word}" != *[][^*?\(\)\<\>\{\}\|]* ]] &&
   return 1
 
-zstyle -t ":completion:${curcontext}:" accept-exact ||
-  [[ $? -eq 2 && ! -o recexact ]] ||
+zstyle -s ":completion:${curcontext}:" accept-exact tmp ||
+    [[ ! -o recexact ]] || tmp=1
+
+if [[ "$tmp" != (yes|true|on|1) ]]; then
   { [[ "$word" = \~(|[-+]) ||
-       ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ||
-       ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -ne 1 ) ||
+       ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ]] && return 1 }
+  { [[ ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -gt 1 ) ||
        ( "$word" = *\$[a-zA-Z0-9_]## && 
-         ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && return 1 }
+         ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && continue=1 }
+  [[ continue -eq 1 && "$tmp" != continue ]] && return 1
+fi
 
 # In exp we will collect the expansions.
 
@@ -217,4 +222,4 @@ else
   compstate[insert]=menu
 fi
 
-return 0
+return continue