From 3d9d13e918c195f974ff7b2f1dc5b65f6b20a441 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 22 Nov 1999 12:29:47 +0000 Subject: zsh-workers/8720 --- Completion/Core/_match | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'Completion/Core/_match') diff --git a/Completion/Core/_match b/Completion/Core/_match index 35d7c2ecb..d5556dfcd 100644 --- a/Completion/Core/_match +++ b/Completion/Core/_match @@ -9,8 +9,8 @@ # expand-or-complete function because otherwise the pattern will # be expanded using globbing. -local tmp opm="$compstate[pattern_match]" ret=0 curcontext="$curcontext" -local orig ins +local tmp opm="$compstate[pattern_match]" ret=0 orig ins +local curcontext="${curcontext}:match" # Do nothing if we don't have a pattern or there are still global # match specifications to try. @@ -19,12 +19,8 @@ tmp="${${:-$PREFIX$SUFFIX}#[~=]}" [[ "$tmp:q" = "$tmp" || compstate[matcher] -ne compstate[total_matchers] ]] && return 1 -# Probably set initial context. - -[[ -z "$curcontext" ]] && curcontext=':match' - _style -s '' original orig -_style -s '' insert ins +_style -b '' insert-unambiguous ins # Try completion without inserting a `*'? @@ -36,7 +32,7 @@ if [[ -n "$orig" ]]; then compstate[matcher]="$compstate[total_matchers]" if (( ret )); then - [[ "$ins" = unambig* && + [[ "$ins" = yes && $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] && compstate[pattern_insert]=unambiguous return 0 @@ -53,7 +49,7 @@ _complete && ret=1 compstate[pattern_match]="$opm" compstate[matcher]="$compstate[total_matchers]" -[[ ret -eq 1 && "$ins" = unambig* && +[[ ret -eq 1 && "$ins" = yes && $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] && compstate[pattern_insert]=unambiguous -- cgit 1.4.1