[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient d987847 1/5: transient-force-single-column: N
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient d987847 1/5: transient-force-single-column: New option |
Date: |
Thu, 1 Jul 2021 11:13:40 -0400 (EDT) |
branch: externals/transient
commit d9878476fcddb5a21b1ca8409e84bbba4fbf336b
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient-force-single-column: New option
Re ^122.
---
lisp/transient.el | 31 ++++++++++++++++++++++++-------
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index ecb94ab..d610d4a 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -301,6 +301,15 @@ be remapped to `fixed-pitch' in that buffer."
:group 'transient
:type 'boolean)
+(defcustom transient-force-single-column nil
+ "Whether to force use of a single column to display suffixes.
+
+This might be useful for users with low vision who use large
+text and might otherwise have to scroll in two dimensions."
+ :package-version '(transient . "0.3.6")
+ :group 'transient
+ :type 'boolean)
+
(defcustom transient-default-level 4
"Control what suffix levels are made available by default.
@@ -2926,13 +2935,21 @@ have a history of their own.")
(cw (mapcar (lambda (col) (apply #'max (mapcar #'length col)))
columns))
(cc (transient--seq-reductions-from (apply-partially #'+ 3) cw 0)))
- (dotimes (r rs)
- (dotimes (c cs)
- (insert (make-string (- (nth c cc) (current-column)) ?\s))
- (when-let ((cell (nth r (nth c columns))))
- (insert cell))
- (when (= c (1- cs))
- (insert ?\n))))))
+ (if transient-force-single-column
+ (dotimes (c cs)
+ (dotimes (r rs)
+ (when-let ((cell (nth r (nth c columns))))
+ (unless (equal cell "")
+ (insert cell ?\n))))
+ (unless (= c (1- cs))
+ (insert ?\n)))
+ (dotimes (r rs)
+ (dotimes (c cs)
+ (insert (make-string (- (nth c cc) (current-column)) ?\s))
+ (when-let ((cell (nth r (nth c columns))))
+ (insert cell))
+ (when (= c (1- cs))
+ (insert ?\n)))))))
(cl-defmethod transient--insert-group ((group transient-subgroups))
(let* ((subgroups (oref group suffixes))