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

menu-select doesn't work with zle -C/_describe



Hi!

While writing a completion function, I noticed the following problem:
I have included the zsh/complist module and wanted to make a
completion widget bound to a specific key combination. My approach
looks like this:

_x () {
    local -a x
    x=(one two three four)
    compadd -a x
}
zle -C x menu-select _x
bindkey '^Xx' x

If I press Ctrl-X x at any point, the completion axpands to any of the
four arguments or presents a menu (with the selected entry being
reversed).

Now I want to add a describtion, so I change the function to:

    local -a x expl
    x=(one two three four)
    _description files expl 'xxx'
    compadd "$expl[@]" -a x

When I press Ctrl-X x now, the menu is printed with a caption and the
prompt is re-printed below it, but I am not able to select anything
from the menu (no entry is highlighted). The same effect occurs when I
use

    _wanted files expl 'xxx' compadd -a x

or

    _describe -t files 'xxx' x

The only way to insert a caption and still get the menu-select
behaviour is to use `compadd -X ".."' and insert the format-code used
for descriptions by hand. But this can't be it, right?

I greatly appreciate any hint on what I'm doing wrong here! :-)

Julius



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