aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2026-01-07 09:44:20 -0300
committerRaúl Benencia <id@rbenencia.name>2026-01-07 09:44:20 -0300
commit46636046accc4c3350ff2d5ae009b7fd49b062a6 (patch)
treea85f34a87d5062884f09434cb52834cc96aa3015
parent65816d0e3e762c96deee3dc0164c530b3e7087de (diff)
Reset idle streak if a gap is detected (suspend likely)
-rw-r--r--org-tempus.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/org-tempus.el b/org-tempus.el
index f07aa63..ef62e7f 100644
--- a/org-tempus.el
+++ b/org-tempus.el
@@ -636,8 +636,11 @@ A session does not reset when switching tasks within
(org-duration-from-minutes
(/ idle-seconds 60.0)))))
(if (< idle-seconds org-tempus-idle-active-threshold-seconds)
- (setq org-tempus--idle-active-streak
- (+ org-tempus--idle-active-streak org-tempus-idle-check-interval))
+ (when (or (not (numberp since-last))
+ (and (>= since-last org-tempus-idle-check-interval)
+ (<= since-last (* 2 org-tempus-idle-check-interval))))
+ (setq org-tempus--idle-active-streak
+ (+ org-tempus--idle-active-streak org-tempus-idle-check-interval)))
(setq org-tempus--idle-active-streak 0))
(when (and (>= org-tempus--idle-active-streak
org-tempus-idle-active-streak-seconds)
nihil fit ex nihilo