branch: externals/transient commit 32b7a99bf25fbf43fcc6efb9712a2c0888edd3eb Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
transient--align-to: New function --- lisp/transient.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index 52b01261de..1ad5c4ebe3 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3802,17 +3802,13 @@ have a history of their own.") ,@(let ((transient--pending-group column)) (mapcar #'transient-format (oref column suffixes)))))) (oref group suffixes))) - (vp (or (oref transient--prefix variable-pitch) - transient-align-variable-pitch)) (stops (transient--column-stops columns))) (dolist (row (apply #'transient--mapn #'list columns)) (let ((stops stops)) (dolist (cell row) (let ((stop (pop stops))) (when cell - (insert (if vp - (propertize " " 'display `(space :align-to (,stop))) - (make-string (max 0 (- stop (current-column))) ?\s))) + (transient--align-to stop) (insert cell))))) (insert ?\n))))) @@ -4144,6 +4140,13 @@ If the OBJ's `key' is currently unreachable, then apply the face (oref transient--prefix column-widths)) 0))) +(defun transient--align-to (stop) + (unless (zerop stop) + (insert (if (or transient-align-variable-pitch + (oref transient--prefix variable-pitch)) + (propertize " " 'display `(space :align-to (,stop))) + (make-string (max 0 (- stop (current-column))) ?\s))))) + (defun transient-command-summary-or-name (obj) "Return the summary or name of the command represented by OBJ.