aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chime.el1
-rw-r--r--tests/test-integration-chime-mode.el11
2 files changed, 12 insertions, 0 deletions
diff --git a/chime.el b/chime.el
index 8b4ee74..c75bace 100644
--- a/chime.el
+++ b/chime.el
@@ -1689,6 +1689,7 @@ When called programmatically, returns structured validation results."
(defun chime--stop ()
"Stop the notification timer and cancel any in-progress check."
(-some-> chime--timer (cancel-timer))
+ (setq chime--timer nil)
(when chime--process
(interrupt-process chime--process)
(setq chime--process nil))
diff --git a/tests/test-integration-chime-mode.el b/tests/test-integration-chime-mode.el
index b29b123..0f19330 100644
--- a/tests/test-integration-chime-mode.el
+++ b/tests/test-integration-chime-mode.el
@@ -54,5 +54,16 @@ and set it to nil."
(should-not (memq 'chime-modeline-string global-mode-string))
(should (null chime-modeline-string))))
+(ert-deftest test-integration-chime-mode-disable-nils-timer ()
+ "Disabling chime-mode should set chime--timer to nil."
+ (let ((chime-enable-modeline t)
+ (chime-modeline-lookahead-minutes 60))
+ (chime-mode 1)
+ ;; Timer should exist after enable
+ (should chime--timer)
+ (chime-mode -1)
+ ;; Timer should be nil after disable
+ (should (null chime--timer))))
+
(provide 'test-integration-chime-mode)
;;; test-integration-chime-mode.el ends here