From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: bug scrolling multiline completion displays
Date: Tue, 15 Aug 2006 22:05:05 +0100 [thread overview]
Message-ID: <200608152105.k7FL55KA004206@pwslaptop.csr.com> (raw)
In-Reply-To: Your message of "Sun, 13 Aug 2006 18:41:38 BST." <200608131741.k7DHfcw2024024@pwslaptop.csr.com>
Peter Stephenson wrote:
> On a completely separate completion matter, only I'm lazy, there's still
> a subtle bug in zsh/complist when scrolling is active (i.e. not all
> completions fit on the screen) with lines that wrap (i.e. are larger
> than the column width). It's OK when scrolling forwards (i.e. down,
> since across won't be possible in this case), but if you attempt to
> scroll back up from the line after the wrapping line, instead of showing
> you the wrapping line it repeats the line you were just on. Then you're
> stuck at that point; you can't go up further.
Found it... and this time I more or less understood what it was doing.
I feel a little bit funny.
Actually, it's fairly obvious... printfmt() in zle_tricky.c() is even
documented(!) to return a number of lines, so dividing the return value
by the screen width is not the right thing to do. Still took me two
days to find, though.
I have no idea why this didn't show up before; it appears the code has
always been like this. Before I edited the line to try to get columns
right, it was last edited by Sven in 2000.
I'll add some commentary to complist.c if I can convince myself I've
worked out enough of what's going on.
Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.92
diff -u -r1.92 complist.c
--- Src/Zle/complist.c 14 Aug 2006 13:29:30 -0000 1.92
+++ Src/Zle/complist.c 15 Aug 2006 20:57:26 -0000
@@ -1529,11 +1529,7 @@
}
}
if (!dolist(ml)) {
- int nc = printfmt(m->disp, 0, 0, 0);
- if (nc)
- mlprinted = (nc - 1) / columns;
- else
- mlprinted = 0;
+ mlprinted = printfmt(m->disp, 0, 0, 0);
return 0;
}
if (m->gnum == mselect) {
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
prev parent reply other threads:[~2006-08-15 21:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-13 17:41 PATCH: _list_files with quoted characters (etc.) Peter Stephenson
2006-08-15 21:05 ` Peter Stephenson [this message]
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=200608152105.k7FL55KA004206@pwslaptop.csr.com \
--to=p.w.stephenson@ntlworld.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).