From bc9e764f4e9b95ec4c2a855c4118f6afb994e904 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 15 Sep 1999 14:35:16 +0000 Subject: zsh-workers/7844 --- Completion/Core/_approximate | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Completion/Core/_approximate') diff --git a/Completion/Core/_approximate b/Completion/Core/_approximate index 61f21c5b9..667f9919d 100644 --- a/Completion/Core/_approximate +++ b/Completion/Core/_approximate @@ -168,10 +168,21 @@ while [[ _comp_correct -le comax ]]; do "${#compstate[unambiguous]}" -ge "${#:-$PREFIX$SUFFIX}" ]]; then compstate[pattern_insert]=unambiguous elif [[ compstate[nmatches] -gt 1 || "$cfgorig" = *always* ]]; then + local expl + + if [[ "$cfgorig" = *show* ]]; then + if [[ -n "$compconfig[description_format]" ]]; then + expl=(-X "${compconfig[description_format]//\\%d/original}") + else + expl=() + fi + else + expl=(-n) + fi if [[ "$cfgorig" = *last* ]]; then - builtin compadd -U -V _correct_original -nQ - "$PREFIX$SUFFIX" + builtin compadd "$expl[@]" -U -V _correct_original -Q - "$PREFIX$SUFFIX" elif [[ -n "$cfgorig" ]]; then - builtin compadd -U -nQ - "$PREFIX$SUFFIX" + builtin compadd "$expl[@]" -U -Q - "$PREFIX$SUFFIX" fi # If you always want to see the list of possible corrections, -- cgit 1.4.1