Fix scrolling with partial line corner case (Bug#25792)
commitf0e7f39e0b4026a3d613416ad8ffc84e6b74242b
authorNoam Postavsky <npostavs@gmail.com>
Mon, 20 Feb 2017 18:34:39 +0000 (20 13:34 -0500)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 25 Feb 2017 04:15:40 +0000 (24 23:15 -0500)
treede043d57f09d116a7fa101c246c7fbefdb71f79c
parente52287ca3e974ed9f658315288060f638081abb0
Fix scrolling with partial line corner case (Bug#25792)

Also fix up the scrolling tests so that they don't make so many
assumptions about the current window configuration.

* src/xdisp.c (try_window): Take partial line height into account when
comparing cursor position against scroll margin.

* test/manual/scroll-tests.el (scroll-tests-with-buffer-window): Add
HEIGHT argument, to allow setting up window with exact height and
partial line.
(scroll-tests-display-buffer-with-height): New display-buffer action
function.
(scroll-tests-scroll-margin-over-max):
(scroll-tests--scroll-margin-whole-window): Pass HEIGHT to
`scroll-tests--scroll-margin-whole-window'.
(scroll-tests-conservative-show-trailing-whitespace): New test.
(scroll-tests-scroll-margin-negative): Fix line counting.
(scroll-tests--point-in-middle-of-window-p): Set window height
properly.
src/xdisp.c
test/manual/scroll-tests.el