Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 672689a

Browse files
jeremy-bryantphikal
authored andcommitted
; Simplify internal defun
* which-key.el (which-key--rotate): Simplify code slightly. Co-authored-by: Philip Kaludercic <[email protected]>
1 parent 8adbc25 commit 672689a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

which-key.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,8 @@ Used when `which-key-popup-type' is frame.")
729729

730730
(defun which-key--rotate (list n)
731731
(let* ((len (length list))
732-
(n (if (< n 0) (+ len n) n))
733-
(n (mod n len)))
734-
(append (last list (- len n)) (butlast list (- len n)))))
732+
(n (- len (mod n len))))
733+
(append (last list n) (butlast list n))))
735734

736735
(defun which-key--pages-set-current-page (pages-obj n)
737736
(setf (which-key--pages-pages pages-obj)

0 commit comments

Comments
 (0)