Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Something odd in _match



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