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

Re: PATCH: Re: expand style `suffix' option



Peter Stephenson wrote:

> ...
> 
> The only glitch I've come across is that you only get the top level
> directory in the list even you are completing to multiple levels,
> e.g. ~/b/b<TAB> shows up a whole load of `bin/'s in the listing.  One can,
> of course, argue that this is perfectly reasonable:  menu completion will
> show the full set.

That bug was in a different place than I first suspected. With
unsorted groups (and neither -1 nor -2) duplicate matches were removed 
but it didn't make sure to hide matches showing the same string in the 
list. I'm pretty sure this wasn't done on purpose.

>  One could wish for an extra directory level to be shown
> to resolve conflicts, but then one could wish for free chocolate.

No change here, one can always set the list-sufffixes style to get
that behaviour (although it would probably be sensible to do that
automatically with menu-completion).


Bye
  Sven

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.50
diff -u -r1.50 compcore.c
--- Src/Zle/compcore.c	2001/08/20 13:13:50	1.50
+++ Src/Zle/compcore.c	2001/10/09 09:43:15
@@ -2654,6 +2654,8 @@
 	    }
 	} else {
 	    if (!(flags & CGF_UNIQALL) && !(flags & CGF_UNIQCON)) {
+                int dup;
+
 		for (ap = rp; *ap; ap++) {
 		    for (bp = cp = ap + 1; *bp; bp++) {
 			if (!matcheq(*ap, *bp))
@@ -2662,6 +2664,17 @@
 			    n--;
 		    }
 		    *cp = NULL;
+                    if (!(*ap)->disp) {
+                        for (dup = 0, bp = ap + 1; *bp; bp++)
+                            if (!(*bp)->disp &&
+                                !((*bp)->flags & CMF_MULT) &&
+                                !strcmp((*ap)->str, (*bp)->str)) {
+                                (*bp)->flags |= CMF_MULT;
+                                dup = 1;
+                            }
+                        if (dup)
+                            (*ap)->flags |= CMF_FMULT;
+                    }
 		}
 	    } else if (!(flags & CGF_UNIQCON)) {
 		int dup;

-- 
Sven Wischnowsky                    wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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