de8d6841b00903f2873a8b009faf7002bfbc1273

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

Message

added pre_functions

Diff

 1diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
 2index f7f039b7825a1c358b351059ecdb743b302eaaa8..231134e7df60cbc47e3929b5d6a4a5640793875f 100644
 3--- a/plugins/timer/timer.plugin.zsh
 4+++ b/plugins/timer/timer.plugin.zsh
 5@@ -10,11 +10,11 @@ __timer_format_duration() {
 6   echo "${format//\%d/${duration_str#0m}}"
 7 }
 8 
 9-preexec() {
10+__timer_save_time_preexec() {
11   __timer_cmd_start_time=$(__timer_current_time)
12 }
13 
14-precmd() {
15+__timer_display_timer_precmd() {
16   if [ -n "${__timer_cmd_start_time}" ]; then
17     local cmd_end_time=$(__timer_current_time)
18     local tdiff=$((cmd_end_time - __timer_cmd_start_time))
19@@ -24,3 +24,6 @@ precmd() {
20     echo -e "\033[1A\033[${cols}C ${tdiffstr}"
21   fi
22 }
23+
24+preexec_functions+=(__timer_save_time_preexec)
25+precmd_functions+=(__timer_display_timer_precmd)