]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't count mode line for scroll-margin limit
authorNoam Postavsky <npostavs@gmail.com>
Sun, 28 Aug 2016 21:23:04 +0000 (17:23 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Fri, 3 Feb 2017 02:19:53 +0000 (21:19 -0500)
* src/window.c (window_scroll_margin): Use window_box_height to avoid
counting header line, scrollbars for scroll-margin limit (Bug #5718).

src/window.c

index 1c83d989aa8034ae934956a2ecffa46746e54600..235c3c1ade8e10aa1813b70a5cf5a4281bc32ee5 100644 (file)
@@ -4800,10 +4800,8 @@ window_scroll_margin (struct window *window, enum margin_unit unit)
   if (scroll_margin > 0)
     {
       int frame_line_height = default_line_pixel_height (window);
-      int window_total_lines
-        = window->total_lines * WINDOW_FRAME_LINE_HEIGHT (window)
-        / frame_line_height;
-      int margin = min (scroll_margin, window_total_lines / 4);
+      int window_lines = window_box_height (window) / frame_line_height;
+      int margin = min (scroll_margin, window_lines / 4);
       if (unit == MARGIN_IN_PIXELS)
         return margin * frame_line_height;
       else