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

Re: ssh completion problem



I wrote:

> ...
> 
> > PS. You may know anyway but with the recent fake style patch (I think
> > the _wanted -x one) which you haven't commited, I get problems with
> > descriptions. grep -<tab> for example lists options and descriptions
> > separately. I haven't tried the very latest patch which has just
> > arrived in the last few minutes.
> 
> Yes, I know, it was caused by the changes in the C-code and hence I
> didn't commit that part.

Here is an improved patch for that part. I was gettng doubled
descriptions (they got added to the wrong group in some cases).

Bye
  Sven

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.53
diff -u -r1.53 compcore.c
--- Src/Zle/compcore.c	22 Jan 2002 10:22:48 -0000	1.53
+++ Src/Zle/compcore.c	18 Feb 2002 14:29:22 -0000
@@ -1619,6 +1619,21 @@
     Heap oldheap;
 
     SWITCHHEAPS(oldheap, compheap) {
+        if (dat->dummies)
+            dat->aflags = ((dat->aflags | CAF_NOSORT | CAF_UNIQCON) &
+                           ~CAF_UNIQALL);
+
+        /* Select the group in which to store the matches. */
+        gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT  : 0) |
+                  ((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) |
+                  ((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0));
+        if (dat->group) {
+            endcmgroup(NULL);
+            begcmgroup(dat->group, gflags);
+        } else {
+            endcmgroup(NULL);
+            begcmgroup("default", 0);
+        }
         if (dat->mesg || dat->exp) {
             curexpl = (Cexpl) zhalloc(sizeof(struct cexpl));
             curexpl->always = !!dat->mesg;
@@ -1630,25 +1645,13 @@
             curexpl = NULL;
     } SWITCHBACKHEAPS(oldheap);
 
-    if (!*argv && !dat->dummies && !(dat->aflags & CAF_ALL)) {
-	SWITCHHEAPS(oldheap, compheap) {
-	    /* Select the group in which to store the matches. */
-	    gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT  : 0) |
-		      ((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) |
-		      ((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0));
-	    if (dat->group) {
-		endcmgroup(NULL);
-		begcmgroup(dat->group, gflags);
-	    } else {
-		endcmgroup(NULL);
-		begcmgroup("default", 0);
-	    }
-	} SWITCHBACKHEAPS(oldheap);
-
+    if (!*argv && !dat->dummies && !(dat->aflags & CAF_ALL))
 	return 1;
-    }
+
+#if 0
     if (dat->dummies)
         dat->aflags = (dat->aflags | CAF_NOSORT | CAF_UNIQCON) & ~CAF_UNIQALL;
+#endif
     for (bp = brbeg; bp; bp = bp->next)
 	bp->curpos = ((dat->aflags & CAF_QUOTE) ? bp->pos : bp->qpos);
     for (bp = brend; bp; bp = bp->next)
@@ -1880,17 +1883,6 @@
 			haspattern = 1;
 		}
 	    }
-	}
-	/* Select the group in which to store the matches. */
-	gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT  : 0) |
-		  ((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) |
-		  ((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0));
-	if (dat->group) {
-	    endcmgroup(NULL);
-	    begcmgroup(dat->group, gflags);
-	} else {
-	    endcmgroup(NULL);
-	    begcmgroup("default", 0);
 	}
 	if (*argv) {
 	    if (dat->pre)

-- 
Sven Wischnowsky                          wischnow@xxxxxxxxx



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