blob: bddc90313b4044665dc88850162df1180d0dbeb9 (
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
|
#compdef -k complete-word \C-x?
setopt localoptions nullglob rcexpandparam extendedglob unset
unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
setopt localtraps noerrexit ; trap - ZERR
(( $+_debug_count )) || integer -g _debug_count
local tmp=${TMPPREFIX}${$}${words[1]:t}$[++_debug_count]
local w="${(qq)words}"
exec 3>&- # Too bad if somebody else is using it ...
[[ -t 2 ]] && exec 3>&2 2>| $tmp
setopt xtrace
_main_complete
integer ret=$?
unsetopt xtrace
[[ -t 3 ]] && {
print -sR "${VISUAL:-${EDITOR:-${PAGER:-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'
exec 2>&3 3>&-
}
return ret
|