Skip to content

Commit

Permalink
; Simplify internal defun
Browse files Browse the repository at this point in the history
* which-key.el (which-key--rotate):
Simplify code slightly.

Co-authored-by: Philip Kaludercic <philipk@posteo.net>
  • Loading branch information
2 people authored and justbur committed Apr 9, 2024
1 parent 8adbc25 commit 672689a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions which-key.el
Expand Up @@ -729,9 +729,8 @@ Used when `which-key-popup-type' is frame.")

(defun which-key--rotate (list n)
(let* ((len (length list))
(n (if (< n 0) (+ len n) n))
(n (mod n len)))
(append (last list (- len n)) (butlast list (- len n)))))
(n (- len (mod n len))))
(append (last list n) (butlast list n))))

(defun which-key--pages-set-current-page (pages-obj n)
(setf (which-key--pages-pages pages-obj)
Expand Down

0 comments on commit 672689a

Please sign in to comment.