From: Noam Postavsky Date: Sun, 28 Aug 2016 21:23:04 +0000 (-0400) Subject: Don't count mode line for scroll-margin limit X-Git-Tag: emacs-26.0.90~858^2~17^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c92fc7a2156a5939439b7236452d4dfcfc13cc89;p=emacs.git Don't count mode line for scroll-margin limit * src/window.c (window_scroll_margin): Use window_box_height to avoid counting header line, scrollbars for scroll-margin limit (Bug #5718). --- diff --git a/src/window.c b/src/window.c index 1c83d989aa8..235c3c1ade8 100644 --- a/src/window.c +++ b/src/window.c @@ -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