aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window.c6
1 files changed, 2 insertions, 4 deletions
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)
4800 if (scroll_margin > 0) 4800 if (scroll_margin > 0)
4801 { 4801 {
4802 int frame_line_height = default_line_pixel_height (window); 4802 int frame_line_height = default_line_pixel_height (window);
4803 int window_total_lines 4803 int window_lines = window_box_height (window) / frame_line_height;
4804 = window->total_lines * WINDOW_FRAME_LINE_HEIGHT (window) 4804 int margin = min (scroll_margin, window_lines / 4);
4805 / frame_line_height;
4806 int margin = min (scroll_margin, window_total_lines / 4);
4807 if (unit == MARGIN_IN_PIXELS) 4805 if (unit == MARGIN_IN_PIXELS)
4808 return margin * frame_line_height; 4806 return margin * frame_line_height;
4809 else 4807 else