From: "Jesper Nygårds" <jesper.nygards@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Three questions about a completer
Date: Wed, 14 Sep 2016 22:32:24 +0200 [thread overview]
Message-ID: <CABZhJg9RR-8kJpfoiBn=0GpjK2fVWNk-Zuz09=CBkbB=AdEnaQ@mail.gmail.com> (raw)
In-Reply-To: <160914093903.ZM29711@torch.brasslantern.com>
[-- Attachment #1: Type: text/plain, Size: 1471 bytes --]
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@brasslantern.com>
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.
>
next prev parent reply other threads:[~2016-09-14 20:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 11:38 Jesper Nygårds
2016-09-12 20:53 ` Oliver Kiddle
2016-09-13 16:16 ` Jesper Nygårds
2016-09-13 19:18 ` Jesper Nygårds
2016-09-14 2:59 ` Bart Schaefer
2016-09-14 7:22 ` Jesper Nygårds
2016-09-14 16:39 ` Bart Schaefer
2016-09-14 20:32 ` Jesper Nygårds [this message]
2016-09-15 4:49 ` Bart Schaefer
2016-09-15 6:01 ` Jesper Nygårds
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='CABZhJg9RR-8kJpfoiBn=0GpjK2fVWNk-Zuz09=CBkbB=AdEnaQ@mail.gmail.com' \
--to=jesper.nygards@gmail.com \
--cc=zsh-users@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).