From 55b0a1aa692b5a52c635ae560e69d92cf38e5cd2 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Sun, 2 Feb 2025 13:33:37 +0100 Subject: [PATCH] Fix padding when using which-key-setup-side-window-right * 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/which-key.el b/lisp/which-key.el index 399aad37e02..dfc895c2576 100644 --- a/lisp/which-key.el +++ b/lisp/which-key.el @@ -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) -- 2.39.5