From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: visible mark and reverse-menu-complete
Date: Thu, 2 Nov 2006 16:22:19 +0000 [thread overview]
Message-ID: <20061102162219.f75d40f8.pws@csr.com> (raw)
In-Reply-To: <slrnekfisf.fso.joerg@alea.gnuu.de>
Jörg Sommer <joerg@alea.gnuu.de> wrote:
> Hi,
>
> I've two problems/questions:
>
> · Is it possible to make the mark (the text between the point where you
> pressed ^@ and the editing point) visible? I thought of something like
> printing the text in inverse mode (\e[7m).
This is tricky. Putting display information between editing characters is
something it would be very nice to do for several reasons, but it would
involve a lot of work on the interface to the screen refresh code. The
problem is that what is output isn't a stream of bytes, it's more like a
grid of characters corresponding to what's on the screen, so we need a way
of supplying characters that won't be printed.
You could imagine a hack where you identified typical termcap sequences
like the above and output them separately without updating the display but
that's horribly non portable and I don't like it at all; what's more it's,
internally at least, half way to a proper solution.
> · To iterate through a list of menu completions I use
> reverse-menu-completion. But if no menu completion startet r-m-c starts
> at the begin of the list not the end.
This looks very much like a bug.
Luckily, there's a simple quick fix, and I have very little interest in
looking for a difficult slow fix...
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.78
diff -u -r1.78 zle_tricky.c
--- Src/Zle/zle_tricky.c 25 Oct 2006 18:01:42 -0000 1.78
+++ Src/Zle/zle_tricky.c 2 Nov 2006 16:16:47 -0000
@@ -345,8 +345,14 @@
reversemenucomplete(char **args)
{
wouldinstab = 0;
- if (!menucmp)
- return menucomplete(args);
+ if (!menucmp) {
+ menucomplete(args);
+ /*
+ * Drop through, since we are now on the first item instead of
+ * the last. We've already updated the display, so this is a
+ * bit inefficient, but it's simple and it works.
+ */
+ }
runhookdef(REVERSEMENUHOOK, NULL);
return 0;
--
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
prev parent reply other threads:[~2006-11-02 16:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-31 22:17 Jörg Sommer
2006-11-02 16:22 ` 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=20061102162219.f75d40f8.pws@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).