justbur / emacs-which-key

Emacs package that displays available keybindings in popup
GNU General Public License v3.0
1.74k stars 87 forks source link

Buffer size calculation breaks when `header-line-format` is set #286

Open ft opened 3 years ago

ft commented 3 years ago

I'm setting header-line-format by default, which is undesirable with which-key-mode. I'm currently fixing this manually in a which-key-init-buffer-hook, but I suppose it would be useful for this to be fixed for other people too. The following does that.

From be352e8ff90250007ab581a8b286e5ef9dcedc98 Mon Sep 17 00:00:00 2001
From: Frank Terbeck <ft@bewatermyfriend.org>
Date: Tue, 6 Apr 2021 17:18:16 +0200
Subject: [PATCH] Unset header-line-format format in " *which-key*" buffer

Similarly to mode-line-format, header-line-format just takes up space and
currently also breaks window size calculations for the buffer. This sets
it to nil in order to suppress its display.

Signed-off-by: Frank Terbeck <ft@bewatermyfriend.org>
---
 which-key.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/which-key.el b/which-key.el
index 55767a9..8b4c60f 100644
--- a/which-key.el
+++ b/which-key.el
@@ -840,6 +840,7 @@ problems at github. If DISABLE is non-nil disable support."
       (setq-local cursor-type nil)
       (setq-local cursor-in-non-selected-windows nil)
       (setq-local mode-line-format nil)
+      (setq-local header-line-format nil)
       (setq-local word-wrap nil)
       (setq-local show-trailing-whitespace nil)
       (run-hooks 'which-key-init-buffer-hook))))
-- 
2.31.0
justbur commented 3 years ago

Thank you. I just applied it