From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1704 invoked from network); 7 Aug 2006 15:41:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Aug 2006 15:41:27 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 8010 invoked from network); 7 Aug 2006 15:41:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Aug 2006 15:41:21 -0000 Received: (qmail 26688 invoked by alias); 7 Aug 2006 15:41:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22589 Received: (qmail 26679 invoked from network); 7 Aug 2006 15:41:12 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Aug 2006 15:41:12 -0000 Received: (qmail 7385 invoked from network); 7 Aug 2006 15:41:12 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 7 Aug 2006 15:41:11 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly20c.srv.mailcontrol.com (MailControl) with ESMTP id k77FT1xS019054 for ; Mon, 7 Aug 2006 16:41:07 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Mon, 7 Aug 2006 16:40:37 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.4/8.13.4) with ESMTP id k77FeaEq020902 for ; Mon, 7 Aug 2006 16:40:36 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k77FeWcL020899 for ; Mon, 7 Aug 2006 16:40:36 +0100 Message-Id: <200608071540.k77FeWcL020899@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: complist with long display lines Date: Mon, 07 Aug 2006 16:40:32 +0100 From: Peter Stephenson X-OriginalArrivalTime: 07 Aug 2006 15:40:37.0347 (UTC) FILETIME=[D43E7B30:01C6BA37] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-04-01 (www.mailcontrol.com) on 10.67.0.130 Amazingly, I think I may have fixed a bug in completion. With the following (note long line which might get messed up in the post): _testcomp() { compadd \ averylongbitoftextthatshouldcausethedisplaytowrapovertothenextlinewitheffectsthatremaintobeseen \ bach cach dach each fach gach hach } compdef _testcomp testcomp and menu selection in effect, type "testcomp ". The long line should appear and be highlighted. Now hit again. The display is messed up: if you see what I see, everything is printed two lines too low. The following appears to fix it. It moves the cursor back to get the line calculation in singledraw() correct. Index: Src/Zle/complist.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v retrieving revision 1.85 diff -u -r1.85 complist.c --- Src/Zle/complist.c 3 Aug 2006 15:37:50 -0000 1.85 +++ Src/Zle/complist.c 7 Aug 2006 15:33:46 -0000 @@ -1649,6 +1649,8 @@ g = mgtab[ml1 * columns + mc1]; clprintm(g, mtab[ml1 * columns + mc1], mcc1, ml1, lc1, (g->widths ? g->widths[mcc1] : g->width)); + if (mlprinted) + (void) tcmultout(TCUP, TCMULTUP, mlprinted); putc('\r', shout); if (md2 != md1) @@ -1658,6 +1660,8 @@ g = mgtab[ml2 * columns + mc2]; clprintm(g, mtab[ml2 * columns + mc2], mcc2, ml2, lc2, (g->widths ? g->widths[mcc2] : g->width)); + if (mlprinted) + (void) tcmultout(TCUP, TCMULTUP, mlprinted); putc('\r', shout); if (mstatprinted) { -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php