about summary refs log tree commit diff
path: root/Completion/Core/_sort_tags
blob: 20897823a24537a5de4bcffa95e963177c3549f5 (plain) (blame)
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
#autoload

local stags tag

if zstyle -a ":completion${curcontext}" sort-tags stags; then

  for tag in $stags; do
    [[ $tag != '' ]] && comptry ${=tag}
  done

else

  comptry arguments values
  comptry options

  case "$curcontext" in
  # Some silly examples commented out:
  #
  # *::*p[bgpn]m:*)           # change the order for file-completion
  #   comptry globbed-files directories
  #   comptry all-files
  #   ;;
  # *::dvips::-o*)            # automatic context set by _arguments
  #   comptry all-files
  #   return
  #   ;;
  # *::kill:*)
  #   comptry processes
  #   return                  # this return ensures that we use only processes
  #   ;;
  *)
    comptry globbed-files
    comptry directories
    comptry all-files
    ;;
  esac

  comptry "$@"
fi