From: Thomas Voss Date: Wed, 25 Sep 2024 00:17:49 +0000 (+0200) Subject: Align columns in which-key with wide characters properly X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7b185aeee38c6e13fa255ed45a4e052ba14b2ee0;p=emacs.git Align columns in which-key with wide characters properly In the case that a character takes up multple columns (such as `…' when used as a truncation character), make sure that the columns are still aligned properly. * lisp/which-key.el (which-key--pad-column): Use `string-width' instead of `length'. (Bug#73463) Copyright-paperwork-exempt: yes (cherry picked from commit 7766ba8419955104fb675a6f4134a8a34ea73e43) --- diff --git a/lisp/which-key.el b/lisp/which-key.el index e3048c4a1db..232145f7fb5 100644 --- a/lisp/which-key.el +++ b/lisp/which-key.el @@ -2037,7 +2037,7 @@ that width." (mapcar (pcase-lambda (`(,key ,sep ,desc ,_doc)) (concat (format col-format key sep desc) - (make-string (- col-desc-width (length desc)) ?\s))) + (make-string (- col-desc-width (string-width desc)) ?\s))) col-keys)))) (defun which-key--partition-list (n list)