111dd018b9b821fad2c7899b31aa46b5c0aaa218

Author
Robert Strack <robert.strack@gmail.com>
Committer
Robert Strack <robert.strack@gmail.com>
Date

Message

allow changes in display format

Diff

 1diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
 2index 729dd3ee261f22273b8be8b9e08be26c82da9d61..33481ea4e8f5a6defceec7e87618059213580af7 100644
 3--- a/plugins/timer/timer.plugin.zsh
 4+++ b/plugins/timer/timer.plugin.zsh
 5@@ -4,9 +4,9 @@ __timer_current_time() {
 6 
 7 __timer_format_duration() {
 8   local mins=$(printf '%.0f' $(($1 / 60)))
 9-  local secs=$(printf '%.1f' $(($1 - 60 * mins)))
10+  local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins)))
11   local duration_str=$(echo "${mins}m${secs}s")
12-  echo "\`${duration_str#0m}"
13+  echo "${TIMER_SYMBOL:-\`}${duration_str#0m}"
14 }
15 
16 preexec() {