about summary refs log tree commit diff
path: root/Completion/X/_x_cursor
blob: 416ff49a56fa6e652583dd5c4dd5c66f5ba843d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#autoload

local expl

if (( ! $+_cursor_cache )); then
  local file

  file=( /usr/{include,{{X11R6,openwin},local{,/X11{,R6}}}/include}/X11/cursorfont.h(N) )

  if (( $#file )); then
    _cursor_cache=( "${(@)${(@)${(M@)${(@f)$(< $file[1])}:#*XC_*}[2,-1]#* XC_}% *}" )
  else
    _cursor_cache=( X_cursor )
  fi
fi

_wanted cursors expl 'cursor name' \
    compadd "$@" -M 'm:-=_ r:|_=*' - "$_cursor_cache[@]"