zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: zsh-workers@zsh.org
Subject: Alignment issue with multiple describes
Date: Sat, 20 Apr 2013 22:03:05 -0500	[thread overview]
Message-ID: <CAMP44s1WDkUiwsj1dzW6icUVFq4-noqEDKRS0k3AePxo1Oj6nA@mail.gmail.com> (raw)

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


             reply	other threads:[~2013-04-21  3:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-21  3:03 Felipe Contreras [this message]
2013-04-21  3:03 ` Felipe Contreras
2013-04-21  6:27 ` Bart Schaefer
2013-04-21  8:31   ` Felipe Contreras
2013-04-21 18:27     ` Bart Schaefer
2013-04-21 20:59       ` Felipe Contreras
2013-04-21 21:09         ` Mikael Magnusson
2013-04-21 22:00         ` Felipe Contreras
2013-04-22  6:59         ` Bart Schaefer
2013-04-22  7:30           ` Felipe Contreras

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=CAMP44s1WDkUiwsj1dzW6icUVFq4-noqEDKRS0k3AePxo1Oj6nA@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=zsh-workers@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).