From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3196 invoked from network); 14 Jul 1999 14:07:41 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Jul 1999 14:07:41 -0000 Received: (qmail 10054 invoked by alias); 14 Jul 1999 14:07:30 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7143 Received: (qmail 10047 invoked from network); 14 Jul 1999 14:07:29 -0000 Date: Wed, 14 Jul 1999 16:07:28 +0200 (MET DST) Message-Id: <199907141407.QAA12474@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Wed, 14 Jul 1999 15:11:31 +0200 Subject: Re: file completion bug Peter Stephenson wrote: > Sounds good, but why when I type ^D does the cursor move down one line and > stay there in this case (i.e. existing empty directory)? Happens with a > completely vanilla completion setup. Because the listmatches() functions got really confused if they had to list a list with only hidden matches (they did their trashzle() and at the end thought they had to print a newline). Bye Sven diff -u os/Zle/complist.c Src/Zle/complist.c --- os/Zle/complist.c Wed Jul 14 10:41:24 1999 +++ Src/Zle/complist.c Wed Jul 14 16:03:41 1999 @@ -318,15 +318,6 @@ } getcols(&col); - /* Set the cursor below the prompt. */ - if (inselect) - clearflag = 0; - trashzle(); - showinglist = listshown = 0; - - clearflag = (isset(USEZLE) && !termflags && - complastprompt && *complastprompt); - for (g = amatches; g; g = g->next) { char **pp = g->ylist; int nl = 0, l; @@ -403,6 +394,18 @@ nlines += 1 + ((1 + niceztrlen(m->str)) / columns); } } + if (!nlines) { + showinglist = listshown = 0; + return 1; + } + /* Set the cursor below the prompt. */ + if (inselect) + clearflag = 0; + trashzle(); + showinglist = listshown = 0; + + clearflag = (isset(USEZLE) && !termflags && + complastprompt && *complastprompt); /* Maybe we have to ask if the user wants to see the list. */ if ((!minfo.cur || !minfo.asked) && diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Wed Jul 14 13:46:56 1999 +++ Src/Zle/zle_tricky.c Wed Jul 14 16:03:58 1999 @@ -7949,13 +7949,6 @@ int nlines = 0, ncols, nlist = 0, longest = 1, pnl = 0; int of = isset(LISTTYPES), opl = 0; - /* Set the cursor below the prompt. */ - trashzle(); - showinglist = listshown = 0; - - clearflag = (isset(USEZLE) && !termflags && - complastprompt && *complastprompt); - for (g = amatches; g; g = g->next) { char **pp = g->ylist; int nl = 0, l; @@ -8031,6 +8024,16 @@ nlines += 1 + ((1 + niceztrlen(m->str)) / columns); } } + if (!nlines) { + showinglist = listshown = 0; + return 1; + } + /* Set the cursor below the prompt. */ + trashzle(); + showinglist = listshown = 0; + + clearflag = (isset(USEZLE) && !termflags && + complastprompt && *complastprompt); /* Maybe we have to ask if the user wants to see the list. */ if ((!minfo.cur || !minfo.asked) && -- Sven Wischnowsky wischnow@informatik.hu-berlin.de