From b87de8beb17582608afb7e9f30e67085c5d78d7a Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 25 Sep 2024 02:17:49 +0200 Subject: [PATCH] Align columns with wide characters properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the case that a character in 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'. Copyright-paperwork-exempt: yes --- 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 91eb05c..fb0685c 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) -- 2.46.1