emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master c92fc7a 2/6: Don't count mode line for scroll-margi


From: Noam Postavsky
Subject: [Emacs-diffs] master c92fc7a 2/6: Don't count mode line for scroll-margin limit
Date: Fri, 3 Feb 2017 02:38:32 +0000 (UTC)

branch: master
commit c92fc7a2156a5939439b7236452d4dfcfc13cc89
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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).
---
 src/window.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/window.c b/src/window.c
index 1c83d98..235c3c1 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



reply via email to

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