From: Pier Paolo Grassi <pierpaolog@gmail.com>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: space after completion
Date: Fri, 28 Sep 2018 14:16:22 +0200 [thread overview]
Message-ID: <CAP+y1xA3fLVznpJKPQ9i2QmE5RRLvfZ9ACq6o0jc=4W9-L0eTw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
Hello, I have noticed that when I define a completion function, which does
something like:
_arguments -s -S -A '-*' \
"*:commands:->commands"
case $state in
(commands)
compadd -S '' -V commands -a -Q -U commands_array
;;
esac
(actual code stripped down a bit)
the array commands_array is populated by some code with the "commands" I
want to have completed.
All works well, but when I choose a command the cursor stops right after
the completion, instead of adding a space like _gnu_generic does when I
complete the options.
This way if I press tab again without inserting a space, the command I
choose gets substituted with the first command from the completion menu and
the menu is presented again.
What would be a good way of achieving the same thing as _gnu_generic? is
there some completion style that can be leveraged here?
thanks in advance
--
Pier Paolo Grassi
email: pierpaolog@gmail.com
linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
founder: https://www.meetup.com/it-IT/Machine-Learning-TO
next reply other threads:[~2018-09-28 12:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 12:16 Pier Paolo Grassi [this message]
2018-09-28 12:51 ` Pier Paolo Grassi
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='CAP+y1xA3fLVznpJKPQ9i2QmE5RRLvfZ9ACq6o0jc=4W9-L0eTw@mail.gmail.com' \
--to=pierpaolog@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).