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

PATCH: Re: Vanishing first character in completion listing

Bart Schaefer wrote:

> Ths is odd.  I was using accept-and-menu-complete to add file names to the
> command line, and when the line wrapped (thus causing the listing to be
> redraw one line farther down) the `B' in `Builtins' vanished.

What irritates me is that it did redraw the list one line farther
down. It didn't do that for me. But maybe that's caused by different
style and option settings.

Anyway, I could reproduce the vanishing-character thing -- not
directly after the wrap-around but one a-a-m-c after it. It looks like 
some display bug for me, maybe it is starting to list when some
variable setting says that there isn't a list to display (are because
it thinks the list is already displayed).

But since after menu completion was started my shell didn't think that 
there was a list below the prompt any more, this was confused
anyway. In fact it cleared showinglist (which means that it actively
`dis-remembered' that there is a list) and later used listshown to
check if it needed to (re-)display a list when starting menu
completion. Asymmetrically, somehow. The patch makes it remember the
value for showinglist when going into menu completion (or when
re-using an old list of matches). That fix avoids the
character-vanishing, too.


Index: Src/Zle/compcore.c
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.38
diff -u -r1.38 compcore.c
--- Src/Zle/compcore.c	2000/08/11 12:19:35	1.38
+++ Src/Zle/compcore.c	2000/10/04 13:14:26
@@ -282,7 +282,7 @@
 do_completion(Hookdef dummy, Compldat dat)
-    int ret = 0, lst = dat->lst, incmd = dat->incmd;
+    int ret = 0, lst = dat->lst, incmd = dat->incmd, osl = showinglist;
     char *s = dat->s;
     char *opm;
     LinkNode n;
@@ -412,6 +412,9 @@
 	if (nmatches > 1 && diffmatches) {
 	    /* There is more than one match. */
 	    ret = do_ambiguous();
+	    if (!showinglist && uselist && listshown && (usemenu == 2 || oldlist))
+		showinglist = osl;
 	} else if (nmatches == 1 || (nmatches > 1 && !diffmatches)) {
 	    /* Only one match. */
 	    Cmgroup m = amatches;

Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx

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