branch: externals/rich-minority
commit a18097b6a1c04b0c581a312f4ac224e2c5b316e7
Author: Clément Pit--Claudel <[email protected]>
Commit: Clément Pit--Claudel <[email protected]>

    Fix alignment of mode names in tooltip
    
    This is useful when lighters include wide characters.
---
 rich-minority.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/rich-minority.el b/rich-minority.el
index 43c5eff..fd66334 100644
--- a/rich-minority.el
+++ b/rich-minority.el
@@ -190,11 +190,13 @@ if the mode line string is empty."
 (defun rm--mode-list-as-string-list ()
   "Return `minor-mode-list' as a simple list of strings."
   (let ((full-list (delq nil (mapcar #'rm-format-mode-line-entry
-                                     minor-mode-alist))))
+                                     minor-mode-alist)))
+        (spacer (propertize " " 'display '(space :align-to 15))))
     (setq rm--help-echo
           (format "Full list:\n%s\n\n%s"
                   (mapconcat (lambda (pair)
-                               (format "   %-15s (%S)" (car pair) (cdr pair)))
+                               (format "   %s%s(%S)"
+                                       (car pair) spacer (cdr pair)))
                              full-list "\n")
                   rm--help-echo-bottom))
     (mapcar #'rm--propertize

Reply via email to