]> code.delx.au - gnu-emacs/commitdiff
Fix last change of grow_mini_window.
authorMartin Rudalics <rudalics@gmx.at>
Tue, 31 Dec 2013 19:06:18 +0000 (20:06 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Tue, 31 Dec 2013 19:06:18 +0000 (20:06 +0100)
* window.c (grow_mini_window): Fix last change.

src/ChangeLog
src/window.c

index a363ce331fa1715e5974ad290af8698088655b0e..93d84b26b9cd9ae6c85da3b7d45c72f35c35f3d3 100644 (file)
@@ -1,3 +1,7 @@
+2013-12-31  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.c (grow_mini_window): Fix last change.
+
 2013-12-31  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsterm.m (windowDidResignKey:): Set mouse_moved to 0 (Bug#8421).
index 1e3d70fd88d81e26372baf5245350da840e94ef0..de1e2d2c068ad5b43b8abe2a68866ff81fd2a7cc 100644 (file)
@@ -4582,24 +4582,24 @@ grow_mini_window (struct window *w, int delta, bool pixelwise)
 
          if (pixelwise)
            {
-             pixel_height = max (min (-XINT (height), INT_MAX - w->pixel_height),
-                                 FRAME_LINE_HEIGHT (f));
+             pixel_height = min (-XINT (height), INT_MAX - w->pixel_height);
              line_height = pixel_height / FRAME_LINE_HEIGHT (f);
            }
          else
            {
-             line_height = max (min (-XINT (height),
-                                     ((INT_MAX - w->pixel_height)
-                                      / FRAME_LINE_HEIGHT (f))),
-                                1);
+             line_height = min (-XINT (height),
+                                ((INT_MAX - w->pixel_height)
+                                 / FRAME_LINE_HEIGHT (f)));
              pixel_height = line_height * FRAME_LINE_HEIGHT (f);
            }
 
          /* Grow the mini-window.  */
          w->pixel_top = r->pixel_top + r->pixel_height;
          w->top_line = r->top_line + r->total_lines;
-         w->pixel_height += pixel_height;
-         w->total_lines += line_height;
+         /* Make sure the mini-window has always at least one line.  */
+         w->pixel_height = max (w->pixel_height + pixel_height,
+                                FRAME_LINE_HEIGHT (f));
+         w->total_lines = max (w->total_lines + line_height, 1);
 
          /* Enforce full redisplay of the frame.  */
          /* FIXME: Shouldn't window--resize-root-window-vertically do it?  */