From 0e3f4cecde90d9c07bfae1a9d522b285bcc8d6a3 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 17 Feb 2000 10:59:46 +0000 Subject: zsh-workers/9772 --- Completion/Core/_approximate | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Completion/Core/_approximate') diff --git a/Completion/Core/_approximate b/Completion/Core/_approximate index ac2b69aad..6c7ae5d77 100644 --- a/Completion/Core/_approximate +++ b/Completion/Core/_approximate @@ -5,12 +5,13 @@ # shown in a list and one can cycle through them as in a menucompletion # or get the corrected prefix. -local _comp_correct _correct_expl comax cfgacc -local curcontext="${curcontext}" oldcontext opm="$compstate[pattern_match]" +# We don't try correction if the string is too short or we have tried it +# already. -# We don't try correction if the string is too short. +[[ _matcher_num -gt 1 || "${#:-$PREFIX$SUFFIX}" -le 1 ]] && return 1 -[[ "${#:-$PREFIX$SUFFIX}" -le 1 ]] && return 1 +local _comp_correct _correct_expl comax cfgacc +local curcontext="${curcontext}" oldcontext opm="$compstate[pattern_match]" [[ "$curcontext" != [^:]#:correct:* ]] && curcontext="${curcontext/:[^:]#:/:approximate:}" -- cgit 1.4.1