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

Re: multiple _message call



Tanaka Akira wrote:

> I found a problem with _message.
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% echo <TAB><^C>
> is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
> is27e1u11% compconf group_matches=yes message_format='%d' description_format='%d' describe_options=yes   
> is27e1u11% _tst () { _message a; _message b }
> is27e1u11% tst <TAB>
> 
> After above operation, I get:
> 
> is27e1u11% tst 
> a              @<- cursor here.
> b
> 
> Although I don't know why, this does not happen without first "echo <TAB><^C>".

It had a small problem when counting the number of matches to show.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Mon Sep  6 14:51:26 1999
+++ Src/Zle/zle_tricky.c	Wed Sep  8 10:56:39 1999
@@ -2739,7 +2739,7 @@
 			   mpl - rpl, 0);
 	    pli = matchparts;
 	}
-	r = dupstring(matchbuf);
+	r = dupstring(matchbuf ? matchbuf : "");
 
 	*clp = pli;
 
@@ -7133,7 +7133,8 @@
 				   ((g->flags & CGF_NOSORT) ? 0 : 2),
 				   &nn, &nl);
 	    g->mcount = nn;
-	    g->lcount = nn - nl;
+	    if ((g->lcount = nn - nl) < 0)
+		g->lcount = 0;
 	    if (g->ylist) {
 		g->lcount = arrlen(g->ylist);
 		smatches = 2;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author