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

PATCH: complist with long display lines



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 <TAB>".  The long line
should appear and be highlighted.  Now hit <TAB> 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 <pws@xxxxxxx>                  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



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