zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: menu-select interactive mode
Date: Tue, 26 Apr 2011 09:06:24 +0900	[thread overview]
Message-ID: <a06240803c9dbbcf3316e@kba.biglobe.ne.jp> (raw)

At 11:38 -0700 11/04/24, Bart Schaefer wrote:
> I think what *should* happen (from the user's
>point of view) is that the line is restored back to just "ls " (the
>starting point of menu completion) before selection begins.

Yes, that is much more user friendly.

> That is
>stored in the global struct "minfo" but I don't know the conditions
>in which it's OK to access that

I *guess* it may be OK at least when minfo.cur != NULL.

> and whether minfo.pos points into a
>metafied or unmetafied line.

I believe minfo.pos points into zlemetaline. The only explicit assignment
to minfo.pos is at compresult.c:971 and :1329.

I have no idea why the else block is the appropriate place to
set origline etc, but anyway the following patch seems to solve
the *current* problem (but may break somewhere else...).


By the way, is it possible to continue the interactive mode after
accepting a match by hitting Return? I tried hitting ESC-m again
after the Return but it didn't work (either with or without the
following patch, although the behavior was different).
Hitting a key bound to accept-and-hold didn't work either. 
But I believe it is just too much hope.


Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.124
diff -u -r1.124 complist.c
--- Src/Zle/complist.c	24 Apr 2011 19:10:20 -0000	1.124
+++ Src/Zle/complist.c	25 Apr 2011 16:23:22 -0000
@@ -2390,6 +2390,11 @@
     else {
 	wasmeta = 0;
 	metafy_line();
+	if(minfo.cur) {
+	    origline = dupstrpfx(zlemetaline,minfo.pos);
+	    origcs = minfo.pos;
+	    origll = minfo.end;
+	}
     }
     
     if ((s = getsparam("MENUSCROLL"))) {


             reply	other threads:[~2011-04-26  1:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26  0:06 Jun T. [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-04-09 14:56 Mikael Magnusson
2011-04-09 15:02 ` Mikael Magnusson
     [not found]   ` <BANLkTinRkfcNJWnYnooq SDWTYG2q1VrcZQ@mail.gmail.com>
2011-04-09 20:12   ` Bart Schaefer
2011-04-09 20:58     ` Mikael Magnusson
     [not found]       ` <110410074855.ZM9428@ torch.brasslantern.com>
2011-04-10 14:48       ` Bart Schaefer
2011-04-10 15:37         ` Mikael Magnusson
2011-04-10 18:50           ` Bart Schaefer
2011-04-10 19:19             ` Mikael Magnusson
2011-04-24 10:40             ` Jun T.
2011-04-24 18:38               ` Bart Schaefer
     [not found]                 ` <a06240800c9db5111c85e@kba.biglobe.ne.jp>
2011-04-26  0:55                   ` Bart Schaefer
2011-04-26 16:31                     ` Jun T.
2011-04-24 12:18         ` Jun T.
2011-04-24 19:13           ` Bart Schaefer

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=a06240803c9dbbcf3316e@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /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).