emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient 6d6a3fe9fc 6/7: transient--insert-group(colum


From: Jonas Bernoulli
Subject: [elpa] externals/transient 6d6a3fe9fc 6/7: transient--insert-group(columns): Avoid having to use coordinates
Date: Tue, 2 Jul 2024 18:25:55 -0400 (EDT)

branch: externals/transient
commit 6d6a3fe9fca3f6b74881a5d6fe532ff78d4d4c42
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]