fix: null index in org-journal-tags--transient-switches

This commit is contained in:
Pavel Korytov 2022-08-02 23:22:33 +03:00
parent 7578762cda
commit 3914742637

View file

@ -2637,7 +2637,8 @@ are as follows:
OBJ is an instance of the `org-journal-tags--transient-switches'
class."
(let ((choices (oref obj choices)))
(let ((idx (cl-position (oref obj value) choices)))
(let ((idx (or (cl-position (oref obj value) choices)
-1)))
(nth (% (1+ idx) (length choices)) choices))))
(cl-defmethod transient-format-value ((obj org-journal-tags--transient-switches))