branch: externals/transient commit 6d6a3fe9fca3f6b74881a5d6fe532ff78d4d4c42 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
transient--insert-group(columns): Avoid having to use coordinates --- lisp/transient.el | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index 440c704151..52b01261de 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3804,20 +3804,17 @@ have a history of their own.") (oref group suffixes))) (vp (or (oref transient--prefix variable-pitch) transient-align-variable-pitch)) - (rs (apply #'max (mapcar #'length columns))) - (cs (length columns)) - (cc (transient--column-stops columns))) - (dotimes (r rs) - (dotimes (c cs) - (when (> c 0) - (insert - (if vp - (propertize " " 'display `(space :align-to (,(nth c cc)))) - (make-string (max 1 (- (nth c cc) (current-column))) ?\s)))) - (when-let ((cell (nth r (nth c columns)))) - (insert cell)) - (when (= c (1- cs)) - (insert ?\n))))))) + (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))) + (insert cell))))) + (insert ?\n))))) (cl-defmethod transient--insert-group ((group transient-subgroups)) (let ((subgroups (oref group suffixes)))