zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: complist with long display lines
Date: Mon, 07 Aug 2006 16:40:32 +0100	[thread overview]
Message-ID: <200608071540.k77FeWcL020899@news01.csr.com> (raw)

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


             reply	other threads:[~2006-08-07 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-07 15:40 Peter Stephenson [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200608071540.k77FeWcL020899@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).