about summary refs log tree commit diff
path: root/Completion/Core/_approximate
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-03 16:46:56 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-03 16:46:56 +0000
commit17f0c30d462386010284b2da03f0f108ca7d5114 (patch)
tree9db58aceda357b10d2af1b8cce53152fadb17d75 /Completion/Core/_approximate
parent208ddbc3e8ee7f937171927869a17bd4ef882ff1 (diff)
downloadzsh-17f0c30d462386010284b2da03f0f108ca7d5114.tar.gz
zsh-17f0c30d462386010284b2da03f0f108ca7d5114.tar.xz
zsh-17f0c30d462386010284b2da03f0f108ca7d5114.zip
manual/8876
Diffstat (limited to 'Completion/Core/_approximate')
-rw-r--r--Completion/Core/_approximate15
1 files changed, 8 insertions, 7 deletions
diff --git a/Completion/Core/_approximate b/Completion/Core/_approximate
index 9c2e35306..f10d6588c 100644
--- a/Completion/Core/_approximate
+++ b/Completion/Core/_approximate
@@ -59,9 +59,9 @@ compadd() {
     PREFIX="(#a${_comp_correct})$PREFIX"
   fi
   if [[ -n "$_correct_prompt" ]]; then
-    builtin compadd -X "$_correct_prompt" -J _correct "$@"
+    builtin compadd -X "$_correct_prompt" -J corrections "$@"
   else
-    builtin compadd -J _correct "$@"
+    builtin compadd -J corrections "$@"
   fi
 }
 
@@ -78,6 +78,11 @@ compstate[matcher]=-1
 
 _correct_prompt="${cfgps//\\%e/1}"
 
+_setup original corrections
+
+[[ "$cfgorig" != *last* ]] && builtin compadd -V original
+builtin compadd -J corrections
+
 [[ -z "$compstate[pattern_match]" ]] && compstate[pattern_match]='*'
 
 while [[ _comp_correct -le comax ]]; do
@@ -99,11 +104,7 @@ while [[ _comp_correct -le comax ]]; do
       else
         expl=(-n)
       fi
-      if [[ "$cfgorig" = *last* ]]; then
-        builtin compadd "$expl[@]" -U -V _correct_original -Q - "$PREFIX$SUFFIX"
-      elif [[ -n "$cfgorig" ]]; then
-	builtin compadd "$expl[@]" -U -Q - "$PREFIX$SUFFIX"
-      fi
+      builtin compadd "$expl[@]" -U -V original -Q - "$PREFIX$SUFFIX"
 
       # If you always want to see the list of possible corrections,
       # set `compstate[list]=list' here.