From 3d9d13e918c195f974ff7b2f1dc5b65f6b20a441 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 22 Nov 1999 12:29:47 +0000 Subject: zsh-workers/8720 --- Completion/Core/_approximate | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Completion/Core/_approximate') 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. -- cgit 1.4.1