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

Alignment issue with multiple describes



Hi,

I'm trying to write a completion script for many multiple subcommands,
and I want to group them in different tags, which works more or less
fine, however, I've noticed a problem when using more than one
describe: the completion's description is aligned, but only to the
same description, even if they are not grouped.

For example, the script below throws this:
---
extraone                    -- extra command one
one  -- command one
two  -- command two
zbiggertoshowthealignissue  -- extra command two
---

If the tags are group together, the problem is less noticeable, but as
soon as you enter the menu, the alignment changes again (to a proper
one).

You can even see this with zsh's official git completion.

Any ideas?

#compdef foobar

_foobar ()
{
	local -a commands extra
	commands=('one:command one' 'two:command two')
	_describe -t commands 'commands' commands
	extra=('extraone:extra command one' 'zbiggertoshowthealignissue:extra
command two')
	_describe -t extra 'extra' extra
}

-- 
Felipe Contreras



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