summaryrefslogtreecommitdiff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/Completer/_prefix10
1 files changed, 8 insertions, 2 deletions
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++ ))