[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/which-key 4c82226083 6/7: Merge branch 'feat-columnsize
From: |
ELPA Syncer |
Subject: |
[elpa] externals/which-key 4c82226083 6/7: Merge branch 'feat-columnsize' |
Date: |
Sat, 1 Jan 2022 23:57:57 -0500 (EST) |
branch: externals/which-key
commit 4c82226083e8fcf0338cd56fd58be99045398d34
Merge: 99a79236eb 0abac5e025
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>
Merge branch 'feat-columnsize'
---
which-key.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/which-key.el b/which-key.el
index c71c741ee3..644d755c13 100644
--- a/which-key.el
+++ b/which-key.el
@@ -93,6 +93,11 @@ Also adds \"..\". If nil, disable any truncation."
:group 'which-key
:type '(choice integer (const :tag "Disable truncation" nil)))
+(defcustom which-key-min-column-description-width 0
+ "Every column should at least have this width."
+ :group 'which-key
+ :type 'integer)
+
(defcustom which-key-add-column-padding 0
"Additional padding (number of spaces) to add to the left of
each key column."
@@ -1843,12 +1848,12 @@ non-nil, then bindings are collected recursively for
all prefixes."
(rows (apply #'cl-mapcar #'list padded)))
(mapconcat (lambda (row) (mapconcat #'identity row " ")) rows "\n")))
-(defsubst which-key--max-len (keys index)
+(defsubst which-key--max-len (keys index &optional initial-value)
"Internal function for finding the max length of the INDEX
element in each list element of KEYS."
(cl-reduce
(lambda (x y) (max x (which-key--string-width (nth index y))))
- keys :initial-value 0))
+ keys :initial-value (if initial-value initial-value 0)))
(defun which-key--pad-column (col-keys)
"Take a column of (key separator description) COL-KEYS,
@@ -1857,7 +1862,8 @@ that width."
(let* ((col-key-width (+ which-key-add-column-padding
(which-key--max-len col-keys 0)))
(col-sep-width (which-key--max-len col-keys 1))
- (col-desc-width (which-key--max-len col-keys 2))
+ (col-desc-width (which-key--max-len
+ col-keys 2 which-key-min-column-description-width))
(col-width (+ 1 col-key-width col-sep-width col-desc-width)))
(cons col-width
(mapcar (lambda (k)
- [elpa] externals/which-key updated (5f19ec67f5 -> 3c0c7c24ef), ELPA Syncer, 2022/01/01
- [elpa] externals/which-key 8361479d78 2/7: add which-key-elipsis, ELPA Syncer, 2022/01/01
- [elpa] externals/which-key 0abac5e025 5/7: Fix code column width, ELPA Syncer, 2022/01/01
- [elpa] externals/which-key b432fcf581 3/7: Add GNU ELPA badge to README.org, ELPA Syncer, 2022/01/01
- [elpa] externals/which-key 99a79236eb 4/7: Merge pull request #331 from skangas/gnu-elpa-badge, ELPA Syncer, 2022/01/01
- [elpa] externals/which-key 95abb89145 1/7: add which-key-min-column-description-width, ELPA Syncer, 2022/01/01
- [elpa] externals/which-key 4c82226083 6/7: Merge branch 'feat-columnsize',
ELPA Syncer <=
- [elpa] externals/which-key 3c0c7c24ef 7/7: Merge pull request #329 from hans-d/feat-elipsis, ELPA Syncer, 2022/01/01