diff options
Diffstat (limited to 'Completion/Base')
-rw-r--r-- | Completion/Base/Utility/_call_program | 17 | ||||
-rw-r--r-- | Completion/Base/Utility/_describe | 2 | ||||
-rw-r--r-- | Completion/Base/Widget/_complete_debug | 2 |
3 files changed, 18 insertions, 3 deletions
diff --git a/Completion/Base/Utility/_call_program b/Completion/Base/Utility/_call_program index b038a80bc..b65764827 100644 --- a/Completion/Base/Utility/_call_program +++ b/Completion/Base/Utility/_call_program @@ -1,6 +1,13 @@ #autoload +X -local tmp +local tmp err_fd=-1 + +if (( ${debug_fd:--1} > 2 )) +then exec {err_fd}>&2 # debug_fd is saved stderr, 2 is log file +else exec {err_fd}>/dev/null +fi + +{ # Begin "always" block if zstyle -s ":completion:${curcontext}:${1}" command tmp; then if [[ "$tmp" = -* ]]; then @@ -10,4 +17,10 @@ if zstyle -s ":completion:${curcontext}:${1}" command tmp; then fi else eval "$argv[2,-1]" -fi +fi 2>&$err_fd + +} always { + +exec {err_fd}>&- + +} diff --git a/Completion/Base/Utility/_describe b/Completion/Base/Utility/_describe index f899b0ad0..1a9f52f5d 100644 --- a/Completion/Base/Utility/_describe +++ b/Completion/Base/Utility/_describe @@ -96,7 +96,7 @@ while _tags; do fi if [[ -n $_mats ]]; then - compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \ + compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs -O $_mats - \ "${(@)${(@M)${(@P)_mats}##([^:\\]|\\?)##}//\\(#b)(?)/$match[1]}" else compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \ diff --git a/Completion/Base/Widget/_complete_debug b/Completion/Base/Widget/_complete_debug index eff0f8e28..604486376 100644 --- a/Completion/Base/Widget/_complete_debug +++ b/Completion/Base/Widget/_complete_debug @@ -12,6 +12,8 @@ integer debug_fd=-1 exec {debug_fd}>&2 2>| $tmp fi + local -a debug_indent; debug_indent=( '%'{3..20}'(e. .)' ) + local PROMPT4 PS4="${(j::)debug_indent}+%N:%i> " setopt xtrace : $ZSH_NAME $ZSH_VERSION ${1:-_main_complete} |