fix bug in message rendering: stop overriding $i if existing

this small bug caused rewriting the $i variable (often used as
iterator in loops) whenever a log message was produced. Fix also
includes an acceleration of log printing by substituting seq with
native zsh notation.
This commit is contained in:
Jaromil 2017-12-11 08:05:40 +01:00
parent 6696f0c758
commit 6182a56fb6

4
tomb
View File

@ -701,9 +701,9 @@ option_value() {
# Messaging function with pretty coloring
function _msg() {
local msg="$2"
local i
command -v gettext 1>/dev/null 2>/dev/null && msg="$(gettext -s "$2")"
for i in $(seq 3 ${#});
do
for i in {3..${#}}; do
msg=${(S)msg//::$(($i - 2))*::/$*[$i]}
done