Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Three questions about a completer
Hmm, this was much harder than I thought. I see no difference with the
addition of the compstate[insert] line.
I tried this:
_list-result() {
print "state: " $compstate[insert]
compadd -M 'l:|=* m:{[:lower:]}={[:upper:]}' -f ${__lsdir:-HOME}/*
compstate[list]=''
compstate[insert]='menu'
}
In fact, I have not been able to provoke a situation where the first line
does not print out "state: menu". Both if I hit "<alt-e>" and "<alt-E>",
what is printed is always "state: menu".
On Wed, Sep 14, 2016 at 6:39 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
wrote:
> On Sep 14, 9:22am, Jesper Nygards wrote:
> }
> } I am getting closer: the problem with numeric is now solved with your
> } suggestions, as well as turning off the listing of alternatives. However
> } I still have trouble reversing the menu completion direction.
>
> I think all you need is this:
>
> _list-result() {
> compadd -M 'l:|=* m:{[:lower:]}={[:upper:]}' -f ${__lsdir:-HOME}/*
> # Even if there are multiple matches, don't list them out
> compstate[list]=''
> # In case we are already in the middle of a menu completion,
> # ignore the compadd above and continue in the current menu
> compstate[insert]='menu'
> }
>
> It may be necessary in some edge cases to examine $compstate[insert]
> and update it differently; read the doc and experiment with what the
> state of $compstate[insert] is upon entry to _list-result.
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author