120e8620af6e1d7d01159614186403c7a816457d
- Author
- Robert Strack <robert.strack@gmail.com>
- Committer
- Robert Strack <robert.strack@gmail.com>
- Date
Diff
1diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
2index f73d2ab533cb12e2ae27f510b854995bf79500d1..ee2cb66c14ce981a6ba92ac47ebe8571b07cc1e4 100644
3--- a/plugins/timer/timer.plugin.zsh
4+++ b/plugins/timer/timer.plugin.zsh
5@@ -3,12 +3,12 @@ preexec() {
6 }
7
8 precmd() {
9- if [ -n "${__timer_cmd_start_time}" ]; then
10+ if [ -n "$__timer_cmd_start_time" ]; then
11 local cmd_end_time=$(date '+%s')
12- local tdiff=$((${cmd_end_time} - ${__timer_cmd_start_time}))
13+ local tdiff=$((cmd_end_time - __timer_cmd_start_time))
14 unset __timer_cmd_start_time
15 local tdiffstr="$((tdiff / 60))m$((tdiff % 60))s"
16- local cols=$(($COLUMNS - ${#tdiffstr#0m} - 2))
17+ local cols=$((COLUMNS - ${#tdiffstr#0m} - 2))
18 echo -e "\033[1A\033[${cols}C \`${tdiffstr#0m}"
19 fi
20 }