From bd629defe8bf49b38a0e98b82f478d02dd715a81 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 10 Jul 2001 09:25:43 +0000 Subject: (15357) --- Completion/Base/Completer/_prefix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Completion/Base') diff --git a/Completion/Base/Completer/_prefix b/Completion/Base/Completer/_prefix index 86fad12dc..3ec153245 100644 --- a/Completion/Base/Completer/_prefix +++ b/Completion/Base/Completer/_prefix @@ -4,7 +4,7 @@ [[ _matcher_num -gt 1 || -z "$SUFFIX" ]] && return 1 -local comp curcontext="$curcontext" tmp \ +local comp curcontext="$curcontext" tmp suf="$SUFFIX" \ _completer _completer_num \ _matcher _c_matcher _matchers _matcher_num @@ -44,7 +44,13 @@ for tmp in "$comp[@]"; do _matcher="$_c_matcher" fi - [[ "$tmp" != _prefix ]] && "$tmp" && return 0 + if [[ "$tmp" != _prefix ]] && "$tmp"; then + [[ compstate[nmatches] -gt 1 ]] && return 0 + compadd -U -i "$IPREFIX" -I "$ISUFFIX" - "${compstate[unambiguous]%$suf}x" + compstate[list]= + compstate[insert]=unambiguous + return 0 + fi (( _matcher_num++ )) done (( _completer_num++ )) -- cgit 1.4.1