zsh-workers
 help / color / mirror / code / Atom feed
* visible mark and reverse-menu-complete
@ 2006-10-31 22:17 Jörg Sommer
  2006-11-02 16:22 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Jörg Sommer @ 2006-10-31 22:17 UTC (permalink / raw)
  To: zsh-workers

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).

· 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.

  % ls M<key for r-m-c>
  Mail/  Mnt/
  % ls Mail/

  but I expected
  % ls Mnt/

  What I doing wrong?

Bye, Jörg.
-- 
Roesen's Law (http://www.bruhaha.de/laws.html):
Sobald ein Troll, DAU oder Elch im Lauf eines Threads auf heftige Kritik
stößt, argumentiert er mit der Arroganz des Kritikers. Dies kann auch
vorsorglich erfolgen.


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

* 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

end of thread, other threads:[~2006-11-02 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-31 22:17 visible mark and reverse-menu-complete Jörg Sommer
2006-11-02 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).