zsh-workers
 help / color / mirror / code / Atom feed
f51f4a18c97ad682453abd54027c9b8d3e06b8d5 blob 3200 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
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
 
#autoload

local name gropt nopt xopt format gname hidden hide match opts tag sort
local -a sortopt

opts=()

gropt=(-J)
xopt=(-X)
nopt=()
zparseopts -K -D -a nopt 1 2 V=gropt J=gropt x=xopt o:=sortopt
[[ "$gropt" = -V ]] && sortopt=( -o nosort )

3="${${3##[[:blank:]]#}%%[[:blank:]]#}"
[[ -n "$3" ]] && _lastdescr=( "$_lastdescr[@]" "$3" )

zstyle -s ":completion:${curcontext}:$1" group-name gname &&
    [[ -z "$gname" ]] && gname="$1"

_setup "$1" "${gname:--default-}"

name="$2"

zstyle -s ":completion:${curcontext}:$1" format format ||
    zstyle -s ":completion:${curcontext}:descriptions" format format

if zstyle -s ":completion:${curcontext}:$1" hidden hidden &&
   [[ "$hidden" = (all|yes|true|1|on) ]]; then
  [[ "$hidden" = all ]] && format=''
  opts=(-n)
fi
zstyle -s ":completion:${curcontext}:$1" matcher match &&
    opts=($opts -M "$match")
[[ -n "$_matcher" ]] && opts=($opts -M "$_matcher")

# Use sort style, but ignore `menu' value to help _expand.
# Also don't override explicit use of -V or -o.
if (( ! $+sortopt )) &&
  { zstyle -s ":completion:${curcontext}:$1" sort sort ||
     zstyle -s ":completion:${curcontext}:" sort sort; }; then
  if [[ "$sort" = (match|numeric) ]]; then
    sortopt=( -o $sort )
  elif [[ "$sort" != (yes|true|1|on|menu) ]]; then
    sortopt=( -o nosort )
  fi
fi

if [[ -z "$_comp_no_ignore" ]]; then
  zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore ||
    _comp_ignore=()

  if zstyle -s ":completion:${curcontext}:$1" ignore-line hidden; then
    local -a qwords
    qwords=( ${words//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
    case "$hidden" in
    true|yes|on|1) _comp_ignore+=( $qwords );;
    current)       _comp_ignore+=( $qwords[CURRENT] );;
    current-shown)
	    [[ "$compstate[old_list]" = *shown* ]] &&
            _comp_ignore+=( $qwords[CURRENT] );;
    other)         _comp_ignore+=( $qwords[1,CURRENT-1]
				   $qwords[CURRENT+1,-1] );;
    esac
  fi

  # Ensure the ignore option is first so we can override it
  # for fake-always.
  (( $#_comp_ignore )) && opts=( -F _comp_ignore $opts )
else
  _comp_ignore=()
fi

tag="$1"

shift 2
if [[ -z "$1" && $# -eq 1 ]]; then
  format=
elif [[ -n "$format" ]]; then
  zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}"
fi

if [[ -n "$gname" ]]; then
  if [[ -n "$format" ]]; then
    set -A "$name" "$opts[@]" "$nopt[@]" "$sortopt[@]" -J "$gname" "$xopt" "$format"
  else
    set -A "$name" "$opts[@]" "$nopt[@]" "$sortopt" -J "$gname"
  fi
else
  if [[ -n "$format" ]]; then
    set -A "$name" "$opts[@]" "$nopt[@]" "$sortopt" -J -default- "$xopt" "$format"
  else
    set -A "$name" "$opts[@]" "$nopt[@]" "$sortopt" -J -default-
  fi
fi

if ! (( ${funcstack[2,-1][(I)_description]} )); then
  local fakestyle descr
  for fakestyle in fake fake-always; do
    zstyle -a ":completion:${curcontext}:$tag" $fakestyle match ||
    continue

    descr=( "${(@M)match:#*[^\\]:*}" )

    opts=("${(@P)name}")
    if [[ $fakestyle = fake-always && $opts[1,2] = "-F _comp_ignore" ]]; then
      shift 2 opts
    fi
    compadd "${(@)opts}" - "${(@)${(@)match:#*[^\\]:*}:s/\\:/:/}"
    (( $#descr )) && _describe -t "$tag" '' descr "${(@)opts}"
  done
fi

return 0
debug log:

solving f51f4a18c ...
found f51f4a18c in https://inbox.vuxu.org/zsh-workers/76839-1543195550.251964@c6AU.RX4q.p78d/
found 304c747a6 in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 304c747a690420fb783ef937c8b4e2713a727570	Completion/Base/Core/_description

applying [1/1] https://inbox.vuxu.org/zsh-workers/76839-1543195550.251964@c6AU.RX4q.p78d/
diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description
index 304c747a6..f51f4a18c 100644

Checking patch Completion/Base/Core/_description...
Applied patch Completion/Base/Core/_description cleanly.

index at:
100644 f51f4a18c97ad682453abd54027c9b8d3e06b8d5	Completion/Base/Core/_description

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