about summary refs log tree commit diff
path: root/Completion/Core/_sep_parts
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-04 14:57:19 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-04 14:57:19 +0000
commitf71a7de56fa5fcc4b94f8e3a6344729511bd686d (patch)
tree479397c832980ab3b880ee45d9e57ea00e1b53bb /Completion/Core/_sep_parts
parentd05db5e29f3798e398c11fc416b4c093b3ef8338 (diff)
downloadzsh-f71a7de56fa5fcc4b94f8e3a6344729511bd686d.tar.gz
zsh-f71a7de56fa5fcc4b94f8e3a6344729511bd686d.tar.xz
zsh-f71a7de56fa5fcc4b94f8e3a6344729511bd686d.zip
zsh-workers/9197
Diffstat (limited to 'Completion/Core/_sep_parts')
-rw-r--r--Completion/Core/_sep_parts12
1 files changed, 9 insertions, 3 deletions
diff --git a/Completion/Core/_sep_parts b/Completion/Core/_sep_parts
index ca97113b1..88e46e1f5 100644
--- a/Completion/Core/_sep_parts
+++ b/Completion/Core/_sep_parts
@@ -63,7 +63,9 @@ while [[ $# -gt 1 ]]; do
   # Get the matching array elements.
 
   PREFIX="${str%%${sep}*}"
-  compadd -O testarr - "${(@P)arr}"
+  builtin compadd -O testarr - "${(@P)arr}"
+  [[ $#testarr -eq 0 && -n "$_comp_correct" ]] &&
+    compadd -O testarr - "${(@P)arr}"
 
   # If there are no matches we give up. If there is more than one
   # match, this is the part we will complete.
@@ -91,7 +93,9 @@ if [[ $# -le 1 || "$str" != *${2}* ]]; then
   # No more separators, build the matches.
 
   PREFIX="$str"
-  compadd -O testarr - "${(@P)arr}"
+  builtin compadd -O testarr - "${(@P)arr}"
+  [[ $#testarr -eq 0 && -n "$_comp_correct" ]] &&
+    compadd -O testarr - "${(@P)arr}"
 fi
 
 [[ $#testarr -eq 0 || ${#testarr[1]} -eq 0 ]] && return 1
@@ -126,7 +130,9 @@ while [[ $# -gt 0 && "$str" == *${1}* ]]; do
     arr=tmparr
   fi
 
-  compadd -O tmparr - "${(@P)arr}"
+  builtin compadd -O tmparr - "${(@P)arr}"
+  [[ $#tmparr -eq 0 && -n "$_comp_correct" ]] &&
+    compadd -O tmparr - "${(@P)arr}"
 
   suffixes=("${(@)^suffixes[@]}${1}${(@)^tmparr}")