Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: problem accepting completion in menu selection



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@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author