zsh-workers
 help / color / mirror / code / Atom feed
cb79960f254295f0821f10562164a4dff2f64114 blob 1548 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
#autoload

# a separated list where each component of the list uses the same
# function.

# -n num : number of items in list [default is unlimited]
# -s sep : specify separator [defaults to comma]
# -d     : duplicate values allowed

local curcontext="$curcontext" nm="$compstate[nmatches]" pre qsep nosep minus
local ign_pats
local -a opts sep num pref suf cont end ign uniq dedup

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 F:=ign d=uniq M+: J+: V+: 1 2 o+: X+: x+:
(( $#cont )) && curcontext="${curcontext%:*}:$cont[2]"
(( $#sep )) || sep[2]=,

if (( $+suf[(r)-S] )); then
  end="${(q)suf[suf[(i)-S]+1]}"
  (( $#end )) && compset -S ${end}\* && suf=() && nosep=1
fi

ign_pats=$ign[2]
if [[ $ign_pats == \(*\) ]]; then
  ign=( ${=ign_pats[2,-2]} )
elif [[ -n $ign_pats ]]; then
  ign=( ${(P)ign_pats} )
else
  ign=()
fi

qsep="${sep[2]}"
compquote -p qsep
if (( ! $#uniq )); then
  (( $+pref[(r)-P] )) && pre="${(q)pref[pref[(i)-P]+1]}"
  dedup=( "${(@)${(@ps.$qsep.)PREFIX#$pre}[1,-2]}" "${(@)${(@ps.$qsep.)SUFFIX}[2,-1]}" )
  [[ -n $compstate[quoting] ]] || dedup=( ${(Q)dedup} )
  ign+=( "$dedup[@]" )
fi

if (( $#num )) && compset -P $(( num[2] - 1 )) \*${(q)qsep}; then
  pref=()
else
  (( ! nosep && (!$#num || num[2] > 1) )) && suf=( -S ${qsep} -r "$end[1]${(q)qsep[1]} \t\n\-" )
  compset -S ${(q)qsep}\* && suf=()
  compset -P \*${(q)qsep} && pref=()
fi

(( minus = argv[(ib:2:)-] ))
"${(@)argv[1,minus-1]}" "$opts[@]" -F ign "$pref[@]" "$suf[@]" "${(@)argv[minus+1,-1]}"
debug log:

solving cb79960f2 ...
found cb79960f2 in https://inbox.vuxu.org/zsh-workers/3932941583753550@myt2-a7d7570d35ff.qloud-c.yandex.net/
found c1ff32184 in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 c1ff32184e6a7ebd3f0e557b4d8c856dccb0c9f5	Completion/Base/Utility/_sequence

applying [1/1] https://inbox.vuxu.org/zsh-workers/3932941583753550@myt2-a7d7570d35ff.qloud-c.yandex.net/
diff --git a/Completion/Base/Utility/_sequence b/Completion/Base/Utility/_sequence
index c1ff32184..cb79960f2 100644

Checking patch Completion/Base/Utility/_sequence...
Applied patch Completion/Base/Utility/_sequence cleanly.

index at:
100644 cb79960f254295f0821f10562164a4dff2f64114	Completion/Base/Utility/_sequence

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).