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

Re: 3.1.5++ completion listing problem



On Dec 12,  3:38pm, Peter Stephenson wrote:
} Subject: 3.1.5++ completion listing problem
}
} % zsh -f
} % mkdir foo
} % touch foo/bar1
} % ls foo/^D
} <nothing printed>
} 
} ^D won't list if there is a unique match any more.

This appears to have come from Sven in zsh-workers/4510.  Relevant hunk
of zle_tricky.c diff, uudecoded from Sven't blob for your pleasure:

Index: DO NOT APPLY THIS PATCH, it's a fragment
***************
*** 3568,3587 ****
      return l + (cc / columns);
  }
  
  /* List the matches.  Note that the list entries are metafied. */
  
  /**/
  void
  listmatches(void)
  {
!     int longest = 1, fct, fw, colsz, t0, t1, ct, up, cl, xup = 0;
!     int off = 0, boff = 0, nboff = 0;
!     int of = (!aylist && isset(LISTTYPES) && !(haswhat & HAS_MISC));
!     char **arr, **ap, sav;
!     int nfpl, nfsl, nlpl, nlsl;
!     int listmax = getiparam("LISTMAX"), litnl = 0;
!     size_t (*strlenfn) _((char const *));
  
  #ifdef DEBUG
      /* Sanity check */
      if(!validlist) {
--- 4150,4183 ----
      return l + (cc / columns);
  }
  
+ /* This skips over matches that are not to be listed. */
+ 
+ static Cmatch *
+ skipnolist(Cmatch *p)
+ {
+     while (*p && ((*p)->flags & CMF_NOLIST))
+ 	p++;
+ 
+     return p;
+ }
+ 
  /* List the matches.  Note that the list entries are metafied. */
  
  /**/
  void
  listmatches(void)
  {
!     Cmgroup g;
!     Cmatch *p, m;
!     Cexpl *e;
!     int nlines = 0, ncols, colsz, ngr = 0, nlist = 0, longest = 1, pnl = 0;
!     int of = isset(LISTTYPES), opl = 0;
!     int listmax = getiparam("LISTMAX");
  
+     if (smatches < 2) {
+ 	showinglist = 0;
+ 	return;
+     }
  #ifdef DEBUG
      /* Sanity check */
      if(!validlist) {


I'd suggest simply deleting the "if (smatches < 2)" block, but perhaps
Sven can tell us what side-effect that may have elsewhere?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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