branch: externals/which-key
commit 672689aab8e6b68afa7961fbaa3beaded53b8991
Author: Jeremy Bryant <[email protected]>
Commit: Justin Burkett <[email protected]>

    ; Simplify internal defun
    
    * which-key.el (which-key--rotate):
    Simplify code slightly.
    
    Co-authored-by: Philip Kaludercic <[email protected]>
---
 which-key.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/which-key.el b/which-key.el
index 0c38a1a1bc..660ff22801 100644
--- a/which-key.el
+++ b/which-key.el
@@ -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)

Reply via email to