zsh-workers
 help / color / mirror / code / Atom feed
* Limitations of menuselect
@ 2013-02-25 21:49 Olivier Teuliere
  2013-02-27 17:27 ` Oliver Kiddle
  2013-03-01 23:59 ` Oliver Kiddle
  0 siblings, 2 replies; 9+ messages in thread
From: Olivier Teuliere @ 2013-02-25 21:49 UTC (permalink / raw)
  To: zsh-workers

Hi,

I recently discovered the menu selection feature and I would like to
use it. Unfortunately, it doesn't work as well as I expected (using
zsh 5.0.0), so here are some bug reports and suggestions.

1) Custom bindings don't work. You can try it with the following:
    my-widget() { zle down-line-or-history }; zle -N my-widget;
bindkey -M menuselect k my-widget
(replacing "my-widget" with "down-line-or-history" in the bindkey
command works as expected).
Someone told me on IRC that in menuselect a hard-coded table is used
to lookup the widget names. So, could you add support for custom
widgets in menuselect? This would allow many cool things, in
particular, I think it would let me work-around items 2, 3 and 4
below.

2) Moving the selected menu item line by line is nice, but scrolling
several lines at a time would be nicer (that's what I would expect
PageUp and PageDown to do by default in menuselect, for example). I
couldn't find an existing widget for that.

3) When using the reverse-menu-complete widget to open menuselect, I
would like to select the last result, not the first one (otherwise I
can use menu-complete directly...). It doesn't sem to be possible at
the moment.

4) When moving the selection in the menu, the inserted text changes.
But for some reason, the accept-line widget only closes the menu,
without accepting the line. So to really accept the line I have to
call accept-line again (basically, I have to hit Enter twice). This
behavior seems a bit backwards: if I wanted to accept the current
selection, which is already inserted, I could simply go on typing, I
don't need an extra validation step. So, would it be possible to have
accept-line really accept the line? :) If the current behavior is
still wanted, it could maybe be called "accept-selection", because the
current name is misleading...

5) Apparently, menuselect always inserts the selected text. But if
there was a way (maybe using a style) to select a menu entry without
inserting the corresponding text, it could allow a killer feature:
typing characters could shrink the list of results (for example, by
binding individual letter keys to an appropriate widget...
accept-line-and-infer-history maybe?), while still allowing to select
an item using the arrow keys. Users would get the best of the 2
worlds: if the completion list is too long, typing letters would
shrink it until it's small enough to use arrow keys. Currently, it's
really annoying to open the menu, realize that there are way too many
entries to complete using movement keys, and then undo, type a few
more letters, hoping that this time the menu will not be too long...
:)
Of course, I could use a list instead of a menu, to avoid undoing the
completion if there are too many results. But this wouldn't really
solve the problem: if I use the list-choices widget
In case my description is not clear, you can have a look at the
AutoComplPop plugin for Vim [1], which does exactly that by default
(except that in addition it opens the menu automatically). It's really
a huge time saver.
Would that be possible to implement this feature (optional
non-insertion of selected text)?

I hope that these remarks make sense and that I haven't overlooked
some existing features...

Please Cc: me in the replies, as I didn't subscribe to the list.

Cheers,
-- 
Olivier
[1] http://www.vim.org/scripts/script.php?script_id=1879


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

end of thread, other threads:[~2013-03-02  0:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-25 21:49 Limitations of menuselect Olivier Teuliere
2013-02-27 17:27 ` Oliver Kiddle
2013-02-27 17:53   ` Peter Stephenson
2013-02-27 18:09     ` Peter Stephenson
2013-02-28  1:07   ` Oliver Kiddle
2013-02-28  9:34     ` Olivier Teuliere
2013-02-28 10:15       ` Bart Schaefer
2013-02-28  1:59   ` Bart Schaefer
2013-03-01 23:59 ` Oliver Kiddle

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