aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Burkett2022-01-01 23:28:19 -0500
committerGitHub2022-01-01 23:28:19 -0500
commit3c0c7c24ef457c1de0ba6f20e2baab02f6c6beaf (patch)
tree4345098c047a9dc615da4120158d5bea59d2818b
parent4c82226083e8fcf0338cd56fd58be99045398d34 (diff)
parent8361479d78a2c5dcca25a96b5e70164bb521268c (diff)
downloademacs-3c0c7c24ef457c1de0ba6f20e2baab02f6c6beaf.tar.gz
emacs-3c0c7c24ef457c1de0ba6f20e2baab02f6c6beaf.zip
Merge pull request #329 from hans-d/feat-elipsis
add which-key-elipsis
-rw-r--r--which-key.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/which-key.el b/which-key.el
index 644d755c13c..870894644db 100644
--- a/which-key.el
+++ b/which-key.el
@@ -133,6 +133,15 @@ the default is \" : \"."
133 :group 'which-key 133 :group 'which-key
134 :type 'string) 134 :type 'string)
135 135
136(defcustom which-key-elipsis
137 (if which-key-dont-use-unicode ".." "…")
138 "Elipsis to use when truncating. Default is \"…\", unless
139`which-key-dont-use-unicode' is non nil, in which case
140the default is \"..\"."
141 :group 'which-key
142 :type 'string)
143
144
136(defcustom which-key-prefix-prefix "+" 145(defcustom which-key-prefix-prefix "+"
137 "String to insert in front of prefix commands (i.e., commands 146 "String to insert in front of prefix commands (i.e., commands
138that represent a sub-map). Default is \"+\"." 147that represent a sub-map). Default is \"+\"."
@@ -1580,7 +1589,7 @@ If KEY contains any \"special keys\" defined in
1580(defsubst which-key--truncate-description (desc) 1589(defsubst which-key--truncate-description (desc)
1581 "Truncate DESC description to `which-key-max-description-length'." 1590 "Truncate DESC description to `which-key-max-description-length'."
1582 (let* ((last-face (get-text-property (1- (length desc)) 'face desc)) 1591 (let* ((last-face (get-text-property (1- (length desc)) 'face desc))
1583 (dots (which-key--propertize ".." 'face last-face))) 1592 (dots (which-key--propertize which-key-elipsis 'face last-face)))
1584 (if (and which-key-max-description-length 1593 (if (and which-key-max-description-length
1585 (> (length desc) which-key-max-description-length)) 1594 (> (length desc) which-key-max-description-length))
1586 (concat (substring desc 0 which-key-max-description-length) dots) 1595 (concat (substring desc 0 which-key-max-description-length) dots)