diff options
Diffstat (limited to 'Completion/Core/_approximate')
-rw-r--r-- | Completion/Core/_approximate | 9 |
1 files changed, 5 insertions, 4 deletions
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:}" |