From 8550fbef26c31baa555a9ee09b068999375e50d3 Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Sun, 29 Apr 2007 01:40:35 +0000 Subject: Merge of 1.5: add a colon command so name and version of zsh appear in debug output. --- Completion/Base/Widget/_complete_debug | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Completion/Base/Widget/_complete_debug diff --git a/Completion/Base/Widget/_complete_debug b/Completion/Base/Widget/_complete_debug new file mode 100644 index 000000000..43cea5b11 --- /dev/null +++ b/Completion/Base/Widget/_complete_debug @@ -0,0 +1,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 -- cgit 1.4.1