From 46636046accc4c3350ff2d5ae009b7fd49b062a6 Mon Sep 17 00:00:00 2001 From: Raúl Benencia Date: Wed, 7 Jan 2026 09:44:20 -0300 Subject: Reset idle streak if a gap is detected (suspend likely) --- org-tempus.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'org-tempus.el') 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) -- cgit v1.2.3