[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/which-key 245be33189 05/11: Fix vertical off-by-one err
From: |
ELPA Syncer |
Subject: |
[elpa] externals/which-key 245be33189 05/11: Fix vertical off-by-one error |
Date: |
Thu, 11 Aug 2022 12:58:11 -0400 (EDT) |
branch: externals/which-key
commit 245be33189fdba26997fc565742ce7a0e78232aa
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Fix vertical off-by-one error
When the usage information is displayed at the top or bottom (as
controlled by `which-key-show-prefix'), then we already accounted
for that by putting (- max-height 1) bindings in each row. But
we did not ensure that the max-height is used when displaying the
result. Instead we used (- max-height 1) here too.
When trying to display usage information at the bottom, the result is
that it is not displayed because it is off-window. When displaying at
the top, then it is displayed, but the last binding is off-window and
never displayed.
This bug did not matter (much) when using the default settings because
then the code used for displaying the window actually ignores the
max-height and just uses the height appropriate to display all lines
in the buffer (i.e., (+ max-height 1)). However, other display
methods, including but not necessarily limited to third-party methods
(such as `which-key-posframe') may choose to, or absolutely have to,
respect max-height. In particular, anything that tries to use the
full height of a frame or window, will be affected by this.
---
which-key.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/which-key.el b/which-key.el
index 9d5e403f6d..ba446a5673 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1989,6 +1989,9 @@ is the width of the live window."
(or prefix-title
(which-key--maybe-get-prefix-title
(key-description prefix-keys))))
+ (when prefix-top-bottom
+ ;; Add back the line earlier reserved for the page information.
+ (setf (which-key--pages-height result) max-lines))
(when (and (= (which-key--pages-num-pages result) 1)
(> which-key-min-display-lines
(which-key--pages-height result)))
- [elpa] externals/which-key updated (23fc54eb80 -> 8093644032), ELPA Syncer, 2022/08/11
- [elpa] externals/which-key 783d6954bc 07/11: Support different types for which-key-max-description-length, ELPA Syncer, 2022/08/11
- [elpa] externals/which-key 08d57febc4 08/11: Don't make description longer than allowed when truncating, ELPA Syncer, 2022/08/11
- [elpa] externals/which-key 245be33189 05/11: Fix vertical off-by-one error,
ELPA Syncer <=
- [elpa] externals/which-key e993113868 09/11: Allow truncating without using any ellipsis, ELPA Syncer, 2022/08/11
- [elpa] externals/which-key fe68fe2812 06/11: Avoid unnecessary work, ELPA Syncer, 2022/08/11
- [elpa] externals/which-key 16c992f80f 02/11: Displaying just one column means pages are arranged vertically, ELPA Syncer, 2022/08/11
- [elpa] externals/which-key 2875fcdc93 10/11: Ignore .DS_Store, ELPA Syncer, 2022/08/11
- [elpa] externals/which-key d924a4a766 01/11: Calculate format string only once, ELPA Syncer, 2022/08/11
- [elpa] externals/which-key 254d6fdc2b 03/11: Don't pad beyond maximal width, ELPA Syncer, 2022/08/11
- [elpa] externals/which-key 8093644032 11/11: Merge commit 'pullreqs/343', ELPA Syncer, 2022/08/11
- [elpa] externals/which-key 5fe2d3317d 04/11: Fix horizontal off-by-one error, ELPA Syncer, 2022/08/11