zsh-workers
 help / color / mirror / code / Atom feed
275da157c6d25dcdc9b4cdf8794bcfc5a4f38607 blob 2138 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
 
#compdef -K _expand_alias complete-word \C-xa

local word expl tmp pre sel what
local -a tmpa suf

eval "$_comp_setup"

if [[ -n $funcstack[2] ]]; then
  if [[ "$funcstack[2]" = _prefix ]]; then
    word="$IPREFIX$PREFIX$SUFFIX"
  else
    word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX"
  fi
  pre=()
else
  local curcontext="$curcontext"

  if [[ -z "$curcontext" ]]; then
    curcontext="expand-alias-word:::"
  else
    curcontext="expand-alias-word:${curcontext#*:}"
  fi

  word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX"
  pre=(_main_complete - aliases)
fi

zstyle -s ":completion:${curcontext}:" regular tmp || tmp=yes
case $tmp in
always) sel=r;;
yes|1|true|on) [[ CURRENT -eq 1 ]] && sel=r;;
esac
zstyle -T ":completion:${curcontext}:" global && sel="g$sel"
zstyle -t ":completion:${curcontext}:" disabled && sel="${sel}${(U)sel}"

tmp=
[[ $sel = *r* ]] && tmp=$aliases[$word]
[[ -z $tmp && $sel = *g* ]] && tmp=$galiases[$word]
[[ -z $tmp && $sel = *R* ]] && tmp=$dis_aliases[$word]
[[ -z $tmp && $sel = *G* ]] && tmp=$dis_galiases[$word]

if [[ -n $tmp ]]; then
  # We used to remove the quoting from the value in the parameter.
  # That was probably just an oversight: an alias is always replaced
  # literally.
  tmp=${tmp%%[[:blank:]]##}
  if [[ $tmp[1] = [[:alnum:]_] ]]; then
    tmpa=(${(z)tmp})
    if [[ $tmpa[1] = $word && $tmp = $aliases[$word] ]]; then
      # This is an active regular alias and the first word in the result
      # is the same as what was on the line already.  Quote it so
      # that it doesn't get reexanded on execution.
      #
      # Strictly we also need to check if the original word matches
      # a later word in the expansion and the previous words are
      # all aliases where the expansion ends in " ", but I'm
      # too lazy.
      tmp="\\$tmp"
    fi
  fi
  zstyle -T ":completion:${curcontext}:" add-space || suf=( -S '' )
  $pre _wanted expansions expl expansion compadd -UQ "$suf[@]" -- ${tmp%%[[:blank:]]##} &&
      ! zstyle -t ":completion:${curcontext}:" complete
elif (( $#pre )) && zstyle -t ":completion:${curcontext}:" complete; then
  $pre _aliases -s "$sel" -S ''
else
  return 1
fi
debug log:

solving 275da157c ...
found 275da157c in https://inbox.vuxu.org/zsh-workers/CAHLkEDvg5-vdd_AHeiR9-TstXUh2-5j9yQNDns1mC2qR3zM_Tw@mail.gmail.com/ ||
	https://inbox.vuxu.org/zsh-workers/CAHLkEDtg50kBkKoEfoW-wQ42bcrfZNLEWjDPDqnHunhmk0NRkw@mail.gmail.com/
found 8240e4162 in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 8240e4162f5d26e04ecf33a731d45763684f7075	Completion/Base/Completer/_expand_alias

applying [1/2] https://inbox.vuxu.org/zsh-workers/CAHLkEDvg5-vdd_AHeiR9-TstXUh2-5j9yQNDns1mC2qR3zM_Tw@mail.gmail.com/
diff --git a/Completion/Base/Completer/_expand_alias b/Completion/Base/Completer/_expand_alias
index 8240e4162..275da157c 100644

Checking patch Completion/Base/Completer/_expand_alias...
Applied patch Completion/Base/Completer/_expand_alias cleanly.

skipping https://inbox.vuxu.org/zsh-workers/CAHLkEDtg50kBkKoEfoW-wQ42bcrfZNLEWjDPDqnHunhmk0NRkw@mail.gmail.com/ for 275da157c
index at:
100644 275da157c6d25dcdc9b4cdf8794bcfc5a4f38607	Completion/Base/Completer/_expand_alias

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