diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 2000-02-17 10:59:46 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 2000-02-17 10:59:46 +0000 |
commit | 0e3f4cecde90d9c07bfae1a9d522b285bcc8d6a3 (patch) | |
tree | fcd47ed650a154650b9c11111338fed7ab22932e /Completion/Core/_approximate | |
parent | f82d790d908588684a9f19ace5523a033f0cde99 (diff) | |
download | zsh-0e3f4cecde90d9c07bfae1a9d522b285bcc8d6a3.tar.gz zsh-0e3f4cecde90d9c07bfae1a9d522b285bcc8d6a3.tar.xz zsh-0e3f4cecde90d9c07bfae1a9d522b285bcc8d6a3.zip |
zsh-workers/9772
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:}" |