]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix alignment on font size change in tabulated-list-mode
authorStefan Kangas <stefan@marxist.se>
Fri, 24 Sep 2021 22:33:21 +0000 (00:33 +0200)
committerStefan Kangas <stefan@marxist.se>
Fri, 24 Sep 2021 22:33:21 +0000 (00:33 +0200)
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-col): Fix
bug where the columns didn't align correctly when using
'text-scale-mode' to decrease the font size.  (Bug#48639)

lisp/emacs-lisp/tabulated-list.el

index f148bc1768c18fe697053addab1e0a463ed19b39..5210b2be5e0fa00ae482500a70fc521eb541640c 100644 (file)
@@ -581,7 +581,8 @@ Return the column number after insertion."
       (when not-last-col
         (when (> pad-right 0) (insert (make-string pad-right ?\s)))
         (insert (propertize
-                 (make-string (- width (min width label-width)) ?\s)
+                 ;; We need at least one space to align correctly.
+                 (make-string (- width (min 1 width label-width)) ?\s)
                  'display `(space :align-to ,next-x))))
       (put-text-property opoint (point) 'tabulated-list-column-name name)
       next-x)))