Refactor uses of scroll_margin to a function
commitd17e92da064cabf376597f5de2a8d5a6484bfea6
authorNoam Postavsky <npostavs@gmail.com>
Sun, 28 Aug 2016 20:38:04 +0000 (28 16:38 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Fri, 3 Feb 2017 02:19:52 +0000 (2 21:19 -0500)
treeb608581cb4e883357a753c12e4526cac53066427
parent53c16c75a57aa486dfc1f46ef5aa538264e6ad47
Refactor uses of scroll_margin to a function

Its effective range needs to be clamped between 0 and (window height /
4), so it's better to have this constraint in a single place.

* src/window.c (window_scroll_margin): New function.
(window_scroll_pixel_based, window_scroll_line_based):
(Frecenter, Fmove_to_window_line):
* src/xdisp.c (try_scrolling, try_cursor_movement):
(redisplay_window, try_window, try_window_id): Use it.
src/window.c
src/window.h
src/xdisp.c