]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix padding when using which-key-setup-side-window-right
authorRobert Pluim <rpluim@gmail.com>
Sun, 2 Feb 2025 12:33:37 +0000 (13:33 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Feb 2025 08:00:31 +0000 (09:00 +0100)
* lisp/which-key.el (which-key--pad-column): Insert zero padding
spaces when the description string is longer than the column
width.  (Bug#75765)

(cherry picked from commit a7f34a532cf7d99dac58bd7187f7ad82c1e4d789)

lisp/which-key.el

index 399aad37e02847f7f20a6d81c33b890b67df6079..dfc895c257672214fd78d0107772c12bdf723626 100644 (file)
@@ -2038,7 +2038,7 @@ that width."
           (mapcar (pcase-lambda (`(,key ,sep ,desc ,_doc))
                     (concat
                      (format col-format key sep desc)
-                     (make-string (- col-desc-width (string-width desc)) ?\s)))
+                     (make-string (max (- col-desc-width (string-width desc)) 0) ?\s)))
                   col-keys))))
 
 (defun which-key--partition-list (n list)