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

space after completion



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@xxxxxxxxx
linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
founder: https://www.meetup.com/it-IT/Machine-Learning-TO


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