zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: complist with long display lines
@ 2006-08-07 15:40 Peter Stephenson
  2006-08-07 17:19 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2006-08-07 15:40 UTC (permalink / raw)
  To: Zsh hackers list

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@csr.com>                  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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-08-10 16:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-07 15:40 PATCH: complist with long display lines Peter Stephenson
2006-08-07 17:19 ` Bart Schaefer
2006-08-07 21:56   ` DervishD
2006-08-09 22:04   ` Peter Stephenson
2006-08-10  8:01     ` Bart Schaefer
2006-08-10  9:27       ` Peter Stephenson
2006-08-10 16:22     ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).