fix: compile and completion log messages

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
Vladislav Doster 2023-05-04 06:37:30 -05:00
parent c4e6cb35f4
commit c4446da57e
No known key found for this signature in database
4 changed files with 25 additions and 28 deletions

View file

@ -94,7 +94,7 @@ ____
____
Has 87 line(s). Calls functions:
Has 83 line(s). Calls functions:
.zinit-compile-plugin
|-- zinit-side.zsh/.zinit-compute-ice
@ -349,7 +349,7 @@ ____
____
Has 61 line(s). Calls functions:
Has 62 line(s). Calls functions:
.zinit-install-completions
|-- .zinit-compinit
@ -850,7 +850,7 @@ ____
____
Has 573 line(s). Doesn't call other functions.
Has 549 line(s). Doesn't call other functions.
Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_

View file

@ -1891,7 +1891,7 @@ ____
____
Has 134 line(s). Doesn't call other functions.
Has 117 line(s). Doesn't call other functions.
Called by:
@ -1914,7 +1914,7 @@ ____
____
Has 573 line(s). Doesn't call other functions.
Has 549 line(s). Doesn't call other functions.
Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_

View file

@ -584,16 +584,17 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
fi
done
if (( quiet == 1 && (${#INSTALLED_COMPS} || ${#SKIPPED_COMPS}) )) {
+zinit-message "{msg}Installed {num}${#INSTALLED_COMPS}" \
"{msg}completions. They are stored in the{var}" \
"\$INSTALLED_COMPS{msg} array."
if (( ${#SKIPPED_COMPS} )) {
+zinit-message "{msg}Skipped installing" \
"{num}${#SKIPPED_COMPS}{msg} completions." \
"They are stored in the {var}\$SKIPPED_COMPS{msg} array."
}
}
local comps msg
local -A comp_types=(\$INSTALLED_COMPS 'Installed' \$SKIPPED_COMPS 'Skipped re-installing')
for comps msg in ${(kv)comp_types}; do
local comps_num=${#${(e)comps}}
if (( comps_num > 0 )); then
+zinit-message "{m} ${msg} {num}$comps_num{rst} completion${=${comps_num:#1}:+s}"
if (( quiet == 0 )); then
+zinit-message "{m} Added $comps_num completion${=${comps_num:#1}:+s} to {var}$comps{rst} array"
fi
fi
done
if (( ZSH_SUBSHELL )) {
builtin print -rl -- $INSTALLED_COMPS >! ${TMPDIR:-/tmp}/zinit.installed_comps.$$.lst
@ -847,12 +848,12 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
if [[ -f $plugin_dir/$filename ]] {
reply=( "$plugin_dir" $plugin_dir/$filename )
} elif { ! .zinit-first % "$plugin_dir" } {
+zinit-message "No files for compilation found."
+zinit-message "{m} No files for compilation found"
return 1
}
} else {
.zinit-first "$1" "$2" || {
+zinit-message "No files for compilation found."
+zinit-message "{m} No files for compilation found"
return 1
}
}
@ -861,7 +862,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
first=${reply[-1]}
local fname=${first#$pdir_path/}
+zinit-message -n "{note}Note:{rst} Compiling{ehi}:{rst} {b}{file}$fname{rst}{…}"
+zinit-message -n "{m} Compiling {file}$fname{rst}"
if [[ -z ${ICE[(i)(\!|)(sh|bash|ksh|csh)]} ]] {
() {
builtin emulate -LR zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace}
@ -869,7 +870,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
+zinit-message "{msg2}Warning:{rst} Compilation failed. Don't worry, the plugin will work also without compilation."
+zinit-message "{msg2}Warning:{rst} Consider submitting an error report to Zinit or to the plugin's author."
} else {
+zinit-message " {ok}OK{rst}."
+zinit-message " [{happy}OK{rst}]"
}
# Try to catch possible additional file
zcompile -U "${${first%.plugin.zsh}%.zsh-theme}.zsh" 2>/dev/null
@ -886,7 +887,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
eval "list+=( \$plugin_dir/$~pat(N) )"
}
if [[ ${#list} -eq 0 ]] {
+zinit-message "{u-warn}Warning{b-warn}:{rst} ice {ice}compile{apo}''{rst} didn't match any files."
+zinit-message "{w} ice {ice}compile{apo}''{rst} didn't match any files."
} else {
integer retval
for first in $list; do
@ -896,13 +897,9 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
}
done
builtin print -rl -- ${list[@]#$plugin_dir/} >! ${TMPDIR:-/tmp}/zinit.compiled.$$.lst
+zinit-message -n "{m} {num}${#list}{rst} compiled file${=${list:#1}:+s} added to {var}\$ADD_COMPILED{rst} array"
if (( retval )) {
+zinit-message "{note}Note:{rst} The additional {num}${#list}{rst} compiled files" \
"are listed in the {var}\$ADD_COMPILED{rst} array (operation exit" \
"code: {ehi}$retval{rst})."
} else {
+zinit-message "{note}Note:{rst} The additional {num}${#list}{rst} compiled files" \
"are listed in the {var}\$ADD_COMPILED{rst} array."
+zinit-message " (exit code: {ehi}$retval{rst})"
}
}
fi

View file

@ -217,8 +217,8 @@ if [[ -z $SOURCED && ( ${+terminfo} -eq 1 && -n ${terminfo[colors]} ) || ( ${+te
col-error $'\e[1m\e[38;5;204m' col-meta2 $'\e[38;5;147m' col-pre $'\e[38;5;135m' col-version $'\e[3;38;5;87m'
col-failure $'\e[38;5;204m' col-msg $'\e[0m' col-profile $'\e[38;5;148m' col-warn $'\e[38;5;214m'
col-i $'\e[0;32m'"==>"$'\e[0m' col-e $'\e[1;91m'"Error: "$'\e[0m'
col-m $'\e[0;35m'"==>"$'\e[0m' col-w $'\e[0;33m'"Warning: "$'\e[0m'
col-i $'\e[1m\e[38;5;82m'"==>"$'\e[0m' col-e $'\e[1m\e[38;5;204m'"Error: "$'\e[0m'
col-m $'\e[1m\e[38;5;135m'"==>"$'\e[0m' col-w $'\e[1;38;5;214m'"Warning: "$'\e[0m'
col--… "${${${(M)LANG:#*UTF-8*}:+⋯⋯}:-···}" col-lr "${${${(M)LANG:#*UTF-8*}:+↔}:-"«-»"}"
col-ndsh "${${${(M)LANG:#*UTF-8*}:+}:-}" col-… "${${${(M)LANG:#*UTF-8*}:+…}:-...}"