From 82ea3f8789aae440edc5e73b33ff31d4b013a987 Mon Sep 17 00:00:00 2001 From: justbur Date: Mon, 20 Jul 2015 14:05:42 -0400 Subject: [PATCH] Fix bug in page layout Pages were getting dropped --- which-key.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/which-key.el b/which-key.el index cb855e98c23..972069a36b6 100644 --- a/which-key.el +++ b/which-key.el @@ -852,7 +852,9 @@ element in each list element of KEYS." (push (which-key--join-columns page-cols) pages) (push (* (length page-cols) avl-lines) keys/page) (push page-width page-widths) - (setq n-pages (1+ n-pages) page-cols '() page-width 0)))) + (setq n-pages (1+ n-pages) + page-cols (list (cdr col)) + page-width (car col))))) (when (> (length page-cols) 0) (push (which-key--join-columns page-cols) pages) (push (* (length page-cols) avl-lines) keys/page) @@ -877,6 +879,7 @@ element in each list element of KEYS." (member which-key-side-window-location '(left right)))) (result (which-key--partition-columns keys avl-lines avl-width)) pages keys/page n-pages found prev-result) + (setq int result) (cond ((or vertical (> (plist-get result :n-pages) 1) (= 1 avl-lines)) result) ;; do a simple search for the smallest number of lines