zsh-workers
 help / color / mirror / code / Atom feed
From: Olivier Teuliere <ipkiss@gmail.com>
To: zsh-workers@zsh.org
Subject: Limitations of menuselect
Date: Mon, 25 Feb 2013 22:49:11 +0100	[thread overview]
Message-ID: <CAKuJizHT3YX_xB-t7pxoKHs_q3z-KbJCrdwfHjBNTPL-znqbvQ@mail.gmail.com> (raw)

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


             reply	other threads:[~2013-02-25 21:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 21:49 Olivier Teuliere [this message]
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

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=CAKuJizHT3YX_xB-t7pxoKHs_q3z-KbJCrdwfHjBNTPL-znqbvQ@mail.gmail.com \
    --to=ipkiss@gmail.com \
    --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).