File: _complete_debug

package info (click to toggle)
zsh-beta 4.3.2-dev-1%2B20061127-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 13,260 kB
  • ctags: 6,846
  • sloc: ansic: 83,534; sh: 5,094; makefile: 781; perl: 746; awk: 364; sed: 16
file content (26 lines) | stat: -rw-r--r-- 749 bytes parent folder | download | duplicates (2)
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
#compdef -k complete-word \C-x?

eval "$_comp_setup"

(( $+_debug_count )) || integer -g _debug_count
local tmp=${TMPPREFIX}${$}${words[1]:t}$[++_debug_count]
local pager w="${(qq)words}"

exec 3>&-	# Too bad if somebody else is using it ...
[[ -t 2 ]] && { exec 3>&2 2>| $tmp ; trap 'exec 2>&3 3>&-' EXIT INT }

setopt xtrace
: $ZSH_NAME $ZSH_VERSION
_main_complete
integer ret=$?
unsetopt xtrace

[[ -t 3 ]] && {
    zstyle -s ':completion:complete-debug::::' pager pager
    print -sR "${pager:-${PAGER:-${VISUAL:-${EDITOR:-more}}}} ${(q)tmp} ;: $w"
    _message -r "Trace output left in $tmp (up-history to view)"
    [[ $compstate[nmatches] -le 1 && $compstate[list] != *force* ]] &&
        compstate[list]='list force messages'
}

return ret