zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: problem accepting completion in menu selection
Date: Wed, 01 Jul 2009 17:24:04 +0100	[thread overview]
Message-ID: <200907011624.n61GO4vM017018@news01.csr.com> (raw)
In-Reply-To: <200907012005.13074.arvidjaar@gmail.com>

Andrey Borzenkov wrote:
> Correction - it is not actually menu selection but rather display of
> completion list which is different specie as far as I know. I did not
> test whether I get the same with menu selection off though.

It's behaviour in the zsh/complist module, yes, but there are two things
it can do: show a list without selection (using the listscroll keymap),
or select from a list (using the menuselect keymap).  I haven't changed
the former: space and return still scroll there.  They were doing so in
selection, too, which they shouldn't.

I should, however, consistent with the previous patch, have made
accept-search stop the listing without doing anything else.  Then you
can

  bindkey -M listscroll '\r' accept-search

if you want Enter to exit the list instead of scrolling.

Index: Doc/Zsh/mod_complist.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_complist.yo,v
retrieving revision 1.27
diff -u -r1.27 mod_complist.yo
--- Doc/Zsh/mod_complist.yo	1 Jul 2009 13:41:24 -0000	1.27
+++ Doc/Zsh/mod_complist.yo	1 Jul 2009 16:19:57 -0000
@@ -193,6 +193,9 @@
 item(tt(expand-or-complete-prefix), tt(menu-complete-or-expand))(
 scrolls forward one screenful
 )
+item(tt(accept-search))(
+stop listing but take no other action
+)
 enditem()
 
 Every other character stops listing and immediately processes the key
Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.120
diff -u -r1.120 complist.c
--- Src/Zle/complist.c	1 Jul 2009 13:41:25 -0000	1.120
+++ Src/Zle/complist.c	1 Jul 2009 16:19:57 -0000
@@ -974,6 +974,8 @@
 		   !strcmp(cmd->nam, "menu-complete") ||
 	     !strcmp(cmd->nam, "menu-expand-or-complete"))
 	mrestlines = lines - 1;
+    else if (cmd == Th(z_acceptsearch))
+	ret = 1;
     else {
 	ungetkeycmd();
 	ret = 1;



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


      reply	other threads:[~2009-07-01 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 11:31 Peter Stephenson
2009-07-01 11:43 ` Mikael Magnusson
2009-07-01 16:05 ` Andrey Borzenkov
2009-07-01 16:24   ` 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=200907011624.n61GO4vM017018@news01.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).