about summary refs log tree commit diff
path: root/Completion/Core/_approximate
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-22 12:29:47 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-22 12:29:47 +0000
commit3d9d13e918c195f974ff7b2f1dc5b65f6b20a441 (patch)
treed571aef9c8152287ed94dae1199108de80f0b984 /Completion/Core/_approximate
parenta76b36928c5cbeef3fe015ca30bbf910ab2a107e (diff)
downloadzsh-3d9d13e918c195f974ff7b2f1dc5b65f6b20a441.tar.gz
zsh-3d9d13e918c195f974ff7b2f1dc5b65f6b20a441.tar.xz
zsh-3d9d13e918c195f974ff7b2f1dc5b65f6b20a441.zip
zsh-workers/8720
Diffstat (limited to 'Completion/Core/_approximate')
-rw-r--r--Completion/Core/_approximate12
1 files changed, 5 insertions, 7 deletions
diff --git a/Completion/Core/_approximate b/Completion/Core/_approximate
index 910742fee..0c0c8566f 100644
--- a/Completion/Core/_approximate
+++ b/Completion/Core/_approximate
@@ -7,7 +7,7 @@
 
 local _comp_correct _correct_prompt comax
 local cfgacc cfgorig cfgps cfgins
-local curcontext="$curcontext" oldcontext
+local curcontext="${curcontext}" oldcontext
 
 # Only if all global matchers have been tried.
 
@@ -17,23 +17,21 @@ local curcontext="$curcontext" oldcontext
 
 [[ "${#:-$PREFIX$SUFFIX}" -le 1 ]] && return 1
 
-# Probably set initial context.
-
-[[ -z "$curcontext" ]] && curcontext=':approximate'
+[[ "$curcontext" != *:correct ]] && curcontext="${curcontext}:approximate"
 
 oldcontext="$curcontext"
 
-_style -s '' accept cfgacc
+_style -s '' max-errors cfgacc
 _style -s '' original cfgorig
 _style -s '' prompt cfgps
 _style -s '' insert cfgins
 
 # Get the number of errors to accept.
 
-if [[ "$cfgacc" = *[nN]* && ${NUMERIC:-1} -ne 1 ]]; then
+if [[ "$cfgacc" = *numeric* && ${NUMERIC:-1} -ne 1 ]]; then
   # Stop if we also have a `!'.
 
-  [[ "$cfgacc" = *\!* ]] && return 1
+  [[ "$cfgacc" = *not-numeric* ]] && return 1
 
   # Prefer the numeric argument if that has a sensible value.