zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH] new completion for jot
Date: Mon, 7 Nov 2016 19:20:11 +0900	[thread overview]
Message-ID: <C6B482FA-9751-4A8E-84EA-81BB3F1D3BB3@kba.biglobe.ne.jp> (raw)
In-Reply-To: <AAF946F6-0348-4F53-BB6B-F0BE26AB8711@kba.biglobe.ne.jp>

I'll push the patch with the following modification:

diff --git a/Completion/BSD/Command/_jot b/Completion/BSD/Command/_jot
index 67116d3..e8abcb7 100644
--- a/Completion/BSD/Command/_jot
+++ b/Completion/BSD/Command/_jot
@@ -41,6 +41,7 @@ case $state in
       'c:character'
     )
 
+    compset -P '([^%]#%%)#'
     if compset -P '[^%]#%'; then
       # flags: (|\#)(| )(|+|-)
       compset -P '(\#|\\\#)' && flags=( ${(@)flags:#\#*} )
@@ -56,10 +57,11 @@ case $state in
       if compset -P '((|l)[diouxX]|[feEgGc])'; then
 	_message -e format-rest 'rest of the format' && ret=0
       else
-	(( $#flags )) && _describe -t flags 'flag' flags -S '' && ret=0
-	_describe -t width-precision 'width.precision' digits -S ''  && ret=0
-	_describe -t conversion-specifiers 'conversion specifier' \
-				conversions -S '' && ret=0
+	local opts=( -S '' )
+	_alternative -O opts 'flags:flag:(( $flags ))' \
+	    "width-precision:width.precision:($digits)" \
+	    'conversion-specifiers:conversion specifier:(( $conversions ))' \
+	    && ret=0
       fi
     else
       local expl




      reply	other threads:[~2016-11-07 10:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 19:23 Jun T.
2016-11-07 10:20 ` Jun T. [this message]

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=C6B482FA-9751-4A8E-84EA-81BB3F1D3BB3@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --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).