emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 450633f: Fix mini-window resizing under resize-mini-windows = t


From: Eli Zaretskii
Subject: emacs-27 450633f: Fix mini-window resizing under resize-mini-windows = t
Date: Mon, 30 Dec 2019 10:54:39 -0500 (EST)

branch: emacs-27
commit 450633f85ae336e8a23241ec3ca5de5d8de8dcdd
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix mini-window resizing under resize-mini-windows = t
    
    * src/window.c (grow_mini_window): Fix resizing of mini-window
    when the echo area is cleared, and the caller asks for the
    mini-window to have zero lines.  (Bug#38791)
---
 src/window.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/window.c b/src/window.c
index c52a8ca..1962e07 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5229,10 +5229,15 @@ grow_mini_window (struct window *w, int delta)
 {
   struct frame *f = XFRAME (w->frame);
   int old_height = window_body_height (w, true);
+  int min_height = FRAME_LINE_HEIGHT (f);
 
   eassert (MINI_WINDOW_P (w));
 
-  if ((delta != 0) && (old_height + delta >= FRAME_LINE_HEIGHT (f)))
+  /* Never shrink mini-window to less than its minimum height.  */
+  if (old_height + delta < min_height)
+    delta = old_height > min_height ? min_height - old_height : 0;
+
+  if (delta != 0)
     {
       Lisp_Object root = FRAME_ROOT_WINDOW (f);
       struct window *r = XWINDOW (root);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]