* Re: visible mark and reverse-menu-complete
2006-10-31 22:17 visible mark and reverse-menu-complete Jörg Sommer
@ 2006-11-02 16:22 ` Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2006-11-02 16:22 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] 2+ messages in thread