diff options
| author | Jeremy Bryant | 2024-03-09 21:59:43 +0000 |
|---|---|---|
| committer | Justin Burkett | 2024-03-12 16:32:22 -0400 |
| commit | 61f6c3ed721017e28ed2e80e1ebebf5d8fc0c3d5 (patch) | |
| tree | 8128f1e117ff070337befa4312b53066c32c8abe | |
| parent | 83bb45e16734b26f67122e51dda1ea3671a7928b (diff) | |
| download | emacs-61f6c3ed721017e28ed2e80e1ebebf5d8fc0c3d5.tar.gz emacs-61f6c3ed721017e28ed2e80e1ebebf5d8fc0c3d5.zip | |
; * which-key.el (which-key--truncate-description): Untabify.
| -rw-r--r-- | which-key.el | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/which-key.el b/which-key.el index 985c419f73b..54ec92d2311 100644 --- a/which-key.el +++ b/which-key.el | |||
| @@ -1701,20 +1701,20 @@ If KEY contains any \"special keys\" defined in | |||
| 1701 | (defsubst which-key--truncate-description (desc avl-width) | 1701 | (defsubst which-key--truncate-description (desc avl-width) |
| 1702 | "Truncate DESC description to `which-key-max-description-length'." | 1702 | "Truncate DESC description to `which-key-max-description-length'." |
| 1703 | (let* ((max which-key-max-description-length) | 1703 | (let* ((max which-key-max-description-length) |
| 1704 | (max (cl-etypecase max | 1704 | (max (cl-etypecase max |
| 1705 | (null nil) | 1705 | (null nil) |
| 1706 | (integer max) | 1706 | (integer max) |
| 1707 | (float (truncate (* max avl-width))) | 1707 | (float (truncate (* max avl-width))) |
| 1708 | (function (let ((val (funcall max avl-width))) | 1708 | (function (let ((val (funcall max avl-width))) |
| 1709 | (if (floatp val) (truncate val) val)))))) | 1709 | (if (floatp val) (truncate val) val)))))) |
| 1710 | (if (and max (> (length desc) max)) | 1710 | (if (and max (> (length desc) max)) |
| 1711 | (let ((dots (and (not (equal which-key-ellipsis "")) | 1711 | (let ((dots (and (not (equal which-key-ellipsis "")) |
| 1712 | (which-key--propertize | 1712 | (which-key--propertize |
| 1713 | which-key-ellipsis 'face | 1713 | which-key-ellipsis 'face |
| 1714 | (get-text-property (1- (length desc)) 'face desc))))) | 1714 | (get-text-property (1- (length desc)) 'face desc))))) |
| 1715 | (if dots | 1715 | (if dots |
| 1716 | (concat (substring desc 0 (- max (length dots))) dots) | 1716 | (concat (substring desc 0 (- max (length dots))) dots) |
| 1717 | (substring desc 0 max))) | 1717 | (substring desc 0 max))) |
| 1718 | desc))) | 1718 | desc))) |
| 1719 | 1719 | ||
| 1720 | (defun which-key--highlight-face (description) | 1720 | (defun which-key--highlight-face (description) |