zsh-workers
 help / color / Atom feed
From: oxiedi <oxiedi@yandex.ru>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] Merge ignore and deduplication patterns in _sequence
Date: Sat, 23 May 2020 00:02:47 +0500
Message-ID: <22052201590174167@iva5-64778ce1ba26.qloud-c.yandex.net> (raw)
In-Reply-To: <57004-1590065025.229907@6d4A.1jvX.h7ap>


[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

Thank you for the review.

I believe there is one more issue. In the following example:

  compdef '_sequence _wanted tag expl desc compadd - 1 2 3' foo

the `tag` is not known to _sequence yet. So a user can't ignore matches
using e.g.

  zstyle ':completion:*:foo:*:tag' ignored-patterns 2 '2,*' '*,2,*' '*,2'

which is a bit inconsistent. I'd have fixed it by merging _sequence
patterns with _comp_ignore in _description, but that would be too much
code changes for a small gain.

For now, I suggest to ignore -F and its argument in order to fix the
`command not found: -F` error (patch attached).

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ignore--F-in-_sequence.patch --]
[-- Type: text/x-diff; name="ignore--F-in-_sequence.patch", Size: 1378 bytes --]

diff --git a/Completion/Base/Utility/_sequence b/Completion/Base/Utility/_sequence
index c1ff32184..1a87c1753 100644
--- a/Completion/Base/Utility/_sequence
+++ b/Completion/Base/Utility/_sequence
@@ -8,10 +8,10 @@
 # -d     : duplicate values allowed
 
 local curcontext="$curcontext" nm="$compstate[nmatches]" pre qsep nosep minus
-local -a opts sep num pref suf cont end uniq dedup
+local -a opts sep num pref suf cont end uniq dedup garbage
 
 zparseopts -D -a opts s:=sep n:=num p:=pref i:=pref P:=pref I:=suf S:=suf \
-    q=suf r:=suf R:=suf C:=cont d=uniq M+: J+: V+: 1 2 o+: X+: x+:
+    q=suf r:=suf R:=suf C:=cont F:=garbage d=uniq M+: J+: V+: 1 2 o+: X+: x+:
 (( $#cont )) && curcontext="${curcontext%:*}:$cont[2]"
 (( $#sep )) || sep[2]=,
 
diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index 51f604bcf..a00103946 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -216,6 +216,16 @@ F:regression test workers/31611
 >NO:{3pm}
 >NO:{10pm}
 
+  comptesteval "_tst() { _arguments ':desc:_sequence compadd - 1 2 3' }"
+  comptesteval "zstyle ':completion:*:tst:*' ignored-patterns 2"
+  comptest $'tst 1,\t'
+  comptesteval "zstyle -d ':completion:*:tst:*' ignored-patterns"
+0:-F doesn't break _sequence
+>line: {tst 1,}{}
+>DESCRIPTION:{desc}
+>NO:{2}
+>NO:{3}
+
  comptest $'a=() b=(\t'
 0:multiple envarrays
 >line: {a=() b=(}{}

      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 11:32 oxiedi
2020-05-21 12:43 ` Oliver Kiddle
2020-05-22 19:02   ` oxiedi [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=22052201590174167@iva5-64778ce1ba26.qloud-c.yandex.net \
    --to=oxiedi@yandex.ru \
    --cc=okiddle@yahoo.co.uk \
    --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

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git