Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Something odd in _match
- X-seq: zsh-workers 6977
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Something odd in _match
- Date: Mon, 5 Jul 1999 13:56:13 +0200 (MET DST)
- In-reply-to: "Andrej Borsenkow"'s message of Sat, 3 Jul 1999 16:49:10 +0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Andrej Borsenkow wrote:
> Is it really supposed to be so:
>
> if (( ret )); then
> [[ "$compconfig[match_insert]" = unambig* &&
> $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] &&
> ^^^^^^^
> compstate[pattern_insert]=unambiguous
> return 0
> fi
What's wrong with that?
> and in another place (near the end) the same and even worse :-)
>
> if (( ! ret )); then
> [[ "$compconfig[match_insert]" = unambig* &&
> $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] &&
> compstate[pattern_insert]=unambiguous
> fi
>
> In this case we don't even have a command to execute after condition.
Ok, I was just too lazy when copying that down from the other place.
Bye
Sven
diff -u oc/Core/_match Completion/Core/_match
--- oc/Core/_match Mon Jul 5 10:24:15 1999
+++ Completion/Core/_match Mon Jul 5 13:54:32 1999
@@ -60,10 +60,8 @@
compstate[pattern_match]="$opm"
compstate[matcher]="$compstate[total_matchers]"
-if (( ! ret )); then
- [[ "$compconfig[match_insert]" = unambig* &&
- $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] &&
- compstate[pattern_insert]=unambiguous
-fi
+[[ ret -eq 0 && "$compconfig[match_insert]" = unambig* &&
+ $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] &&
+ compstate[pattern_insert]=unambiguous
return 1-ret
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author